I just received a [bug report] for Python-Markdown complaining that colons are used in the ids of footnotes. For reference, we [output] the same format at PHP Markdown Extra. The general complaint is that the colon in the id attribute (`id="fnref:1"`) causes jquery to choke when referencing that id from javascript because jquery uses colons to indicate pseudo elements (as does CSS). As expected, jquery supports escaping the colon - which eliminates the problem - except that apparently the escaping causes a performance hit. My initial reaction is to say that this is jquery's problem, but what do you think? Should the various implementations that support footnotes all change to not use colons? I couldn't help but note that Gruber's unreleased implementation (what he uses on daringfireball.com) appears to use dashes instead. Any thoughts? [bug report]: https://github.com/waylan/Python-Markdown/issues/180 [output]: http://michelf.ca/projects/php-markdown/extra/#fn-output -- ---- \X/ /-\ `/ |_ /-\ |\| Waylan Limberg
I also do a double-take when IDs have less-ID-friendly characters like colons. It?s also true that it?s best when IDs have characters that neatly and plainly drop into selector strings (e.g. jQuery, CSS). Would changing the implementation break existing links? Is there a workaround, e.g. setting different `name` and `id` attributes, or inserting another named element? On Jan 23, 2013, at 11:29 AM, Waylan Limberg <waylan at gmail.com> wrote:> I just received a [bug report] for Python-Markdown complaining that > colons are used in the ids of footnotes. For reference, we [output] > the same format at PHP Markdown Extra. The general complaint is that > the colon in the id attribute (`id="fnref:1"`) causes jquery to choke > when referencing that id from javascript because jquery uses colons to > indicate pseudo elements (as does CSS). As expected, jquery supports > escaping the colon - which eliminates the problem - except that > apparently the escaping causes a performance hit. > > My initial reaction is to say that this is jquery's problem, but what > do you think? Should the various implementations that support > footnotes all change to not use colons? I couldn't help but note that > Gruber's unreleased implementation (what he uses on > daringfireball.com) appears to use dashes instead. > > Any thoughts? > > [bug report]: https://github.com/waylan/Python-Markdown/issues/180 > [output]: http://michelf.ca/projects/php-markdown/extra/#fn-output > > -- > ---- > \X/ /-\ `/ |_ /-\ |\| > Waylan Limberg > _______________________________________________ > Markdown-Discuss mailing list > Markdown-Discuss at six.pairlist.net > http://six.pairlist.net/mailman/listinfo/markdown-discussAlan Hogan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://six.pairlist.net/pipermail/markdown-discuss/attachments/20130123/19ac11d3/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4887 bytes Desc: not available Url : <http://six.pairlist.net/pipermail/markdown-discuss/attachments/20130123/19ac11d3/attachment.bin>
Le 23-janv.-2013 ? 14:29, Waylan Limberg <waylan at gmail.com> a ?crit :> I just received a [bug report] for Python-Markdown complaining that > colons are used in the ids of footnotes. For reference, we [output] > the same format at PHP Markdown Extra. The general complaint is that > the colon in the id attribute (`id="fnref:1"`) causes jquery to choke > when referencing that id from javascript because jquery uses colons to > indicate pseudo elements (as does CSS). As expected, jquery supports > escaping the colon - which eliminates the problem - except that > apparently the escaping causes a performance hit. > > My initial reaction is to say that this is jquery's problem, but what > do you think? Should the various implementations that support > footnotes all change to not use colons? I couldn't help but note that > Gruber's unreleased implementation (what he uses on > daringfireball.com) appears to use dashes instead. > > Any thoughts?Interestingly, I've been looking at updating the output for footnotes in PHP Markdown, although not the id attribute. <https://github.com/michelf/php-markdown/issues/58> My guess is that Jquery has an optimization for the common pattern "#nocolon" and that putting an escape forces it to take the slow path. Take his example and add a class name (making the selector "#nocolon.anyclass"), or put an ancestor (as in "body #nocolon") and you'll get equal speed everywhere. -- Michel Fortin michel.fortin at michelf.ca http://michelf.ca/
Discovered something similar when using MultiMarkdown to create ePubs --- the colon in the footnotes isn't valid (though seems to work in most readers). Hyphens appear to be valid characters, in that context at least. Any reason not to switch to hyphens instead of colons? Or could even remove altogether I suppose. I would be interested in choosing something more compatible with other implementations rather than everyone going their own route. F- On Jan 23, 2013, at 2:29 PM, Waylan Limberg <waylan at gmail.com> wrote:> I just received a [bug report] for Python-Markdown complaining that > colons are used in the ids of footnotes. For reference, we [output] > the same format at PHP Markdown Extra. The general complaint is that > the colon in the id attribute (`id="fnref:1"`) causes jquery to choke > when referencing that id from javascript because jquery uses colons to > indicate pseudo elements (as does CSS). As expected, jquery supports > escaping the colon - which eliminates the problem - except that > apparently the escaping causes a performance hit. > > My initial reaction is to say that this is jquery's problem, but what > do you think? Should the various implementations that support > footnotes all change to not use colons? I couldn't help but note that > Gruber's unreleased implementation (what he uses on > daringfireball.com) appears to use dashes instead. > > Any thoughts? > > [bug report]: https://github.com/waylan/Python-Markdown/issues/180 > [output]: http://michelf.ca/projects/php-markdown/extra/#fn-output > > -- > ---- > \X/ /-\ `/ |_ /-\ |\| > Waylan Limberg > _______________________________________________ > Markdown-Discuss mailing list > Markdown-Discuss at six.pairlist.net > http://six.pairlist.net/mailman/listinfo/markdown-discuss-- Fletcher T. Penney fletcher at fletcherpenney.net -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4899 bytes Desc: not available Url : <http://six.pairlist.net/pipermail/markdown-discuss/attachments/20130204/ec8e82a6/attachment.bin>