lruiz/MarkdownPapers

Rel attribute in links

Closed this issue · 3 comments

While rendering markdown using this library, generated links always have <a href=".."> and I want to add <a rel="nofollow" href="..."> to eliminate direct page rank referrals from my user-generated content.

Maybe you can put a flag to constructor in order to eliminate this.

Thanks.

Check this code

Reader in = new FileReader("in.md");
Visitor v = new HtmlEmitter();
Parser parser = new Parser(in);

Document doc = parser.parse();
doc.accept(v);

and this class

https://github.com/lruiz/MarkdownPapers/blob/master/core/src/main/java/org/tautua/markdownpapers/HtmlEmitter.java

So basically markdownpapers need to change something in that class. Therefore currently I'm replacing <a with <a rel='nofollow' for now. Hope that also works.

MarkdownPapers should not add a rel='nofollow' - the md spec doesn't mention it. plus it's really on a per basis

You may just extend the class HtmlEmitter, process anchors the way you like and then using the code above generate your document using your new HtmlEmitter.