Submitted by madmatter23 on Mon, 02/13/2012 - 14:18
For each target element, this script will wrap the first letter and the first sentence of the text. This is particularly useful if you need to style Drop Caps or a leading sentence.
Submitted by madmatter23 on Mon, 04/18/2011 - 13:39
After using Drupal's template.php file to preprocess html and add unique classes to various html elements, I because very dependent on page specific css classes. While building a Ruby on Rails app, I thought it would be nice to at least add in a page-specific body class. Here's a quick snippet you can use:
Submitted by madmatter23 on Mon, 04/18/2011 - 11:32
Content migration is a pain, particularly when you are charged with copying content from an old html site into a new framework. Often times, old content comes with the baggage of inline css styling, which wreaks havoc on your pretty new site design. Here's a handful of helpful regexs that I use to strip out undeed inline styling, while still preserving the html element structure.
To strip out span tags:
<span[^>]+>
Follow up to strip out the close tags:
</span>
Strip out inline styling:
style="[^"]+"
FYI:[] defines a character class, ^ excludes characters.
I think you get the idea.
Recent comments