A clean solution for adding _target attribute on flickr thumbnails I have a module relying on media_flickr.

Some images in the body are thumbnails with anchors:

&lt;a class="" href="http://www.flickr.com/photos/28040142@N07/10785045611"&gt;
&lt;img alt="" src="http://farm3.staticflickr.com/2847/10785045615_41c12c8f99_q.jpg" typeof="foaf:Image"&gt;
&lt;/a&gt;


What hook to use to add the _target HTTML attribute on links?

The markup is to be found in 

body['und'][0]['safe_value']


I prefer not to use javascript.
There isn't one - links contained in HTML in a node body are not structured, do not run through l(), and no opportunity is given to 'hook' into them during rendering.

You have 3 options:


Change the markup to include the target attribute.
Preprocess the field and run a regex replace on the HTML to add the attribute.
Use javascript (by far the best option).