Skip to content

Add rel="external" on external links #63

Closed
bfontaine opened this Issue Jan 28, 2013 · 1 comment

2 participants

@bfontaine

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](http://www.google.com)

into this:

<a href="foo">bar</a>, <a href="http://www.google.com" rel="external">google</a>
@michelf
Owner
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.