From: Waylan L. <wa...@gm...> - 2008-08-22 19:25:26
|
Neale, I'm getting the same bug with the included wikilink extension. However, as far as I can tell, the extension is not the problem. It's the way the inline placeholders work that is tripping up these camelcase link generators. I've filed ticket #14 [1] for it. Particularly note the last example I included in that ticket: In [4]: markdown.markdown('[markdownlink](/markdownlink)', ['wikilink']) Out[4]: u'<p>\x02inline:<a class="wikilink" href="/LinkPattern/">LinkPattern</a>:0000\x03</p>' There is absolutely no camelcase words in the text we pass in, so no wikilinks should be generated. However, it appears that the placeholder for the "markdownlink" is inserted into the text as ``\x02LinkPattern:000\x03``. Normally, this would later be replaced by the html for the link. However, before that happens, the wikilink extension looks for a match and finds one for "LinkPattern" which it replaces with a link. Whoops. Obviously, markdown can't use camelcase placeholders. [1]: http://www.freewisdom.org/projects/python-markdown/Tickets/000014 On Thu, Aug 21, 2008 at 6:12 PM, Neale Pickett <ne...@wo...> wrote: > I was the one who suggested the AtomicString change that's recently been > committed. It's probably time to move discussion to the mail list. > > I'm writing a wiki and what prompted the change was that this: > > <http://example.com/CamelCase/foo> > > Would turn into this: > > <a href="http://example.com/CamelCase/foo">http://example.com/<a > href="CamelCase.wki">CamelCase</a>/foo</a> > > AtomicString fixes that by creating a new String class (inherits from > unicode, actually) that won't receive further processing. Then it's a > simple matter of setting `e.text = AtomicString(whatever)`. > > I have a new problem in my WikiLinkPattern class. Here is some > debugging output: > > handlematch u'If you are new to wiki, check out WikiHelp.' > > handlematch u'If you are new to wiki, check out \x02inline:WikiLinkPattern:0000\x03.' > > handlematch u'If you are new to wiki, check out \x02inline:\x02inline:WikiLinkPattern:0001\x03:0000\x03.' > > ad infinitum. My WikiLink regex is matching the inline thingy. > > I know the upstream dudes are at least pondering removing inline > entirely, possibly using a mechanism like AtomicString. Should I hold > off on fixing this locally? > > Neale > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Python-markdown-discuss mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-markdown-discuss > -- ---- Waylan Limberg wa...@gm... |