Posted by Leeland |
|
Looks like something has gone wrong with the URL tags in the posts.
Examples are getting parsed with some kind of CamelCase issue: http://www.NoDsw.com/ http://www.NoDsw.com/blog/ In fact it looks like CamelCase is also turned on in the posts. When this message looks right you'll know it's fixed. |
|
Posted by Herbert Poul |
|
yes.. i noticed that .. my usual solution is to simply escape \CamelCase letters :)
so you think the wiki links should not be replaced if they are either within a tag <.*?> or within an <a> tag ? <a.*?>.*?</a> ? Hey, we have Signatures !!! Great, isn't it ? ;) |
|
Posted by Leeland |
|
Actually I was using the BBCode URL tags which use the square '[' ']' brackets. HTML code in BBCode posts should be converted to the safe html character like '& amp ;'
|
|
Posted by Herbert Poul |
|
well .. it is .. but bbcode [ url ] tags get translated into <a ... > </a> and afterwards the wiki links are replaced:
def render(self, text): return wikilink_utils.render_wikilinks(bbcode.bb2xhtml(text)) so the wiki links (which manages \CamelCase links) has HTML as input .. Hey, we have Signatures !!! Great, isn't it ? ;) |
|
Posted by Leeland |
|
Umm... hmmm ... well that seems odd. Why would you use wiki links in a forum post?
|
|
Posted by Herbert Poul |
|
well .. why not ? i think it makes sense to have a easy method of linking to the wiki .. like Documentation, Captcha, etc. :)
especially because one day i want to implement wiki snip backlinks (ie. recognizing internal links) .. this would make it possible to rename or move snips by automatically replacing all the links .. or at least knowing which page link to where .. and the mechanism of doing internal links .. are wiki links .. either \CamelCase or [blah] but.. i have improved the regular expression to NOT match anything inside a link .. so .. http://www.NoDsw.com/ is working perfectly now .. Hey, we have Signatures !!! Great, isn't it ? ;) |
|
Posted by Leeland |
|
Interesting id. But, I would suggest instead of doing it magically for anything that is CamelCased you instead did it in a more BBCode style. Why not add a special custom tag 'wiki'? Then there would be no accidental wiki links. e.g.:
[ wiki ] TheWikiLink [ / wiki ] [ wiki = TheWikiLink ] The Wiki Snip Link [ / wiki ] |
|
Posted by Leeland |
|
Well I thought about this and played around and decided it just didn't work for me. So I just checked in a minor change to the board classes which adds the SPH setting board_auto_wiki_link_enabled which defaults to True (aka your preferred style). This lets me turn off this behavior via the local settings.
I want to extend the BBCode renderer to add a couple of extended tags one of which will be the wiki tag I mentioned in the previous post. |
|
Posted by Herbert Poul |
|
ok, sounds like a good solution :) thx
(i also like the idea of the wiki tag.. but well .. i'm used to simply writing CamelCase text and have links :) .. although even in the wiki itself it is sometimes preferable to only allow links with square brackets .. because it's annoying to have all class names converted to links :) .. so i guess there is no perfect solution .. having it configurable site-wide makes probably the most sense..) Hey, we have Signatures !!! Great, isn't it ? ;) |
|
Posted by Leeland |
|
Thanks. I started working on trying to get the wiki tag into the BBCode parser but then got side tracked. I am currently working on finishing the BBCode parser (it was annoying me). So I have been pretty side tracked today on this. Once I am sure I have it all working well I'll submit it.
I have a "BBCode that works here" http://www.nodsw.com/board/thread/28/?page=1#post-28 post on my site which should be easily converted to a wiki page once it is done. It shows every BBCode tag and emoticon supported by the BBCode parser with examples of what it looks like and what the generated HTML should look like. I am code crawling to get what is there and comparing that against the BBCode documentation and correcting / adding as needed. I haven't fixed the wiki documentation here yet on the new setting. If you could do that and tell me which wiki page it is on that would be great. |