michelf markdown rel = nofollow

I have been using the michelf markdown transformer for a long time now, and I would like to use it in comment system. There is no way to tell the parser to add attributes to a link (like the rel="nofollow", but it is faily easy to extend the class and override the methods which does the link parsing.

You will need to override the following two methods: _doAnchors_reference_callback and _doAnchors_inline_callback

I added the following filter to the CosCMS framework, and called it markdownNoFollow. This class will add the rel="nofollow" attribute to links.


This page has been viewed 2581 times. First hit: 30-Oct-2015 13:34:32
Share email, Google+, Twitter, Facebook.
comments powered by Disqus
Table