On 2/6/2011 2:44 PM, Mitar wrote:
Hi!

I was checking regex which is passed to wikipagename_with_label_link:

yield (r"!?\[(?P<wiki_page>%s)\s+(?P<wiki_label>%s|[^\]]+)\]"
        % (wiki_page_name, WikiParser.QUOTED_STRING),
        wikipagename_with_label_link)

Why is QUOTED_STRING used here? Isn't [^\]] wide enough? Because the
problem is that this string is not unquoted later on. So if you do
[SandBox "the sandbox"] you get quotation marks in the link label?


Well, it's simple: [^\]] is anything but a ] character... so if you want a ] character, then you use a quote.

But you're right, in that case we get the quotes as well, which is not optimal and not consistent with what we do we fully qualified wiki: links (the "lhref" syntax).

For example:

[link:Argv "*argv[] versus **argv"]
=> <a class="text resolver" href="/stuff/Argv">*argv[] versus **argv</a>

(one of our test cases).

So you're right, we should remove the quotes.

-- Christian

--
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en.

Reply via email to