Skip to content

Add rel="external" on external links #63

bfontaine opened this Issue Jan 28, 2013 · 1 comment

2 participants


For example with an option:

define( 'EXTERNAL_LINKS_REL_ATTR',  "external" );

It’s sometimes useful to add different styles on internal/external links (e.g.: a[rel=external] {color:red}).

This would add a rel attribute on every <a> element which begins with a protocol (https://, http://) or //.

So the converter would transform this:

[bar](foo), [google](

into this:

<a href="foo">bar</a>, <a href="" rel="external">google</a>
michelf commented Feb 1, 2013

I'm not going to add everyone's preferred transformation to PHP Markdown. This can be implemented as a post-processor taking the HTML output and adding rel="external" where needed.

@michelf michelf closed this Feb 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.