djangosnippets.org: Latest snippets tagged with 'regular-expression'http://djangosnippets.org/tags/regular-expression/2008-01-16T11:42:20.081934-06:00Add rel=lightbox to all image-links
2008-01-16T11:42:20.081934-06:00bartTChttp://djangosnippets.org/snippets/548/<p>Add the attribute "rel='lightbox'" to all Links, if the target is an image.</p>
<p><code><a href="/path/to/image.jpg">Image</a></code></p>
<p>becomes</p>
<p><code><a rel="lightbox" href="/path/to/image.jpg">Image</a></code></p>
<p>Works for JPG, GIF and PNG Files.</p>
Freely redistributable