wikicloth
wikicloth copied to clipboard
External links in ToC are not rendered as expected
This is how links in headings are being rendered in ToC on mediawiki.org:
And this is how the same markup is rendered on github.com:
The markup is:
== [https://github.com/nricciar/wikicloth Heading 2] ==
== [https://github.com/nricciar/wikicloth Heading 2] ==
=== [https://github.com/nricciar/wikicloth Heading 3] ===
==== [https://github.com/nricciar/wikicloth Heading 4] ====
===== [https://github.com/nricciar/wikicloth Heading 5] =====
This is a problem with github directly, not wikicloth. Github handles the link markup e.g. [ ] directly so wikicloth never even sees it.
Hi nricciar,
Thank you for the great work on the gem. I just gave GitHub for example. On a clean rails app with the latest version of the gem (0.8.1) the following code produces the same markup:
text = <<-eos
== [https://github.com/nricciar/wikicloth Heading 2] ==
== [https://github.com/nricciar/wikicloth Heading 2] ==
=== [https://github.com/nricciar/wikicloth Heading 3] ===
==== [https://github.com/nricciar/wikicloth Heading 4] ====
===== [https://github.com/nricciar/wikicloth Heading 5] =====
eos
parser = ::WikiCloth::Parser.new(:data => text, :noedit => true)
parser.to_html
Which is different from what is rendered on mediawiki.org. Don't you think the gem should follow mediawiki.org's way of rendering.
Regards, Krum
hmm yea looks like your right, although this may prove kinda complicated to fix. Problem exists because the table of contents is effectively generated prior to parsing the page so the content within the == == tags never gets parsed.
Re-opened this issue though as its definitely a bug sorry about jumping to conclusions :)
+1 Note that this is also occurring for internal links (as in gollum).