Sphene Community Tools

Community

Copyright © 2007-2018 by Herbert Poul

You are not logged in.
Login
Register

Change Language:



AddThis Social Bookmark Button

A Django site.

Powered by Sphene Community Tools
Board » General » Trouble with wikilinks

I started a small Django project -- currently contains sphwiki and the Django admin tool, nothing else.

Most of it works well, but wiki links with slashes in them -- Foo/Bar -- are being parsed very inconsistently. Sometimes the whole thing is taken as the snip name; sometimes it's just Foo; sometimes it's just Bar.

I started up "manage.py shell" to invoke markdown.Markdown directly, and kept seeing the same thing.

>>> print markdown.Markdown('value Foobar/Fizzle end', extensions = [ 'wikilink' ], extension_configs = { 'wikilink': [ ], }, )

<p>value <a href="/wiki/edit/Foobar/Fizzle/" class="sph_wikilink">create:Foobar/Fizzle</a> end
</p>

>>> print markdown.Markdown('value FooBar/Fizzle end', extensions = [ 'wikilink' ], extension_configs = { 'wikilink': [ ], }, )

<p>value [<a href="/wiki/edit/FooBar/" class="sph_wikilink">create:FooBar</a>/Fizzle] end
</p>

(Next step: changing wikilink_utils to use a different link color instead of prepending "create:". But I know how to do that...)
it seems you are right .. there is a problem with using [ ] together with CamelCase wiki links .. (it doesn't really change anything if you have a / somewhere in it) ..
See here: http://sct.sphene.net/wiki/show/Sandbox/#2Wikilinks__MD_autoTOC_5

\FooBar works, [\FooBar] doesn't. the strange thing is tough .. that it works in the board.. but not in the wiki .. altough i'm using the same regular expression.. and they share the same code (mostly)
Hey, we have Signatures !!! Great, isn't it ? ;)
ok.. i've found the problem and fixed it..
if you're using the trunk from subversion, please update it and try again ..

the problem was, that markdown wraps regular expressions from modules into another regex:
    self.compiled_re = re.compile("^(.*)%s(.*)$" % pattern, re.DOTALL)


i've changed it to "^(.*?)%s(.*?)$" for the wikilink module and now it seems to work ...
Hey, we have Signatures !!! Great, isn't it ? ;)
That fixed it. Thanks.

Please login to post a reply.



Powered by Sphene Community Tools