I am trying to make Redcarpet working in a way where I can attach different link attributes depending where the link points to: if this is my other website, don’t add rel="nofollow"
(could be an array with a whitelist addresses), if this is another foreign website, add rel="nofollow"
attribute.
What will be the easiest way to achieve it? I’ve tried to add custom renderer to Redcarpet and was able to achieve it but it broke my other feature which is table of contents (basically the anchor links to headings were gone) so the custom renderer completely overrides all other Redcarpet settings and I don’t know how can I limit it to the normal links that happen in paragraphs only.
Or perhaps there is a simple way that doesn’t involve custom renderers?