sirthias / pegdown

A pure-Java Markdown processor based on a parboiled PEG parser supporting a number of extensions
http://pegdown.org
Apache License 2.0
1.29k stars 218 forks source link

Custom WikiLinkRenderer does not get considered if Extensions.ANCHORLINKS is turned off #239

Open sunitapatro opened 8 years ago

sunitapatro commented 8 years ago

Hi,

I am using pegdown 1.5.0, and found that after upgrading pegdown 1.4.2 to 1.5.0, there was a new extension ANCHORLINKS and if it is turned off, then the custom wikiLinkRenderer is not considered. My use case is to render headers with out anchor links but render wikilinks as specified by the custom wikiLinkRenderer. And it was working as expected with 1.4.2. Here is my code,

PegDownProcessor pegDownProcessor = new PegDownProcessor(Extensions.ALL - (headerLinks ? 0 : Extensions.ANCHORLINKS) - (hardwrap ? 0 : Extensions.HARDWRAPS) + (allowHtml ? 0 : Extensions.SUPPRESS_ALL_HTML));
processed = pegDownProcessor.markdownToHtml(data, new ConfluenceWikiLinkRenderer(info, xhtmlContent));

ConfluenceWikiLinkRenderer is not considered if Extensions.ANCHORLINKS is turned off.

Is there a way to make wikiLinks render with Extensions.ANCHORLINKS turned off?

Any help is appreciated. Thanks!!