bloodhound-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1455454 - in /incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct: multiproduct/api.py tests/product-ticket-link-tests.txt
Date Tue, 12 Mar 2013 09:02:47 GMT
Author: jure
Date: Tue Mar 12 09:02:46 2013
New Revision: 1455454

URL: http://svn.apache.org/r1455454
Log:
#390, handle unmatched nested wiki syntax, patch t390_r1453952_product_wikisyntax_nomatch.diff
applied (from Olemis)


Modified:
    incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/api.py
    incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/product-ticket-link-tests.txt

Modified: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/api.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/api.py?rev=1455454&r1=1455453&r2=1455454&view=diff
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/api.py
(original)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/api.py
Tue Mar 12 09:02:46 2013
@@ -21,6 +21,7 @@
 import copy
 
 from genshi.builder import tag, Element
+from genshi.core import escape
 
 from pkg_resources import resource_filename
 from trac.config import Option, PathOption
@@ -463,7 +464,14 @@ class MultiProductSystem(Component):
                                 if isinstance(link, Element) 
                                     and 'title' in link.attrib 
                                 else link)
-        return subformatter.match(sublink + extra)
+        link = subformatter.match(sublink + extra)
+        if link:
+            return link
+        else:
+            # Return outermost match unchanged like if it was !-escaped
+            for itype, match in fullmatch.groupdict().items():
+                if match and not itype in formatter.wikiparser.helper_patterns:
+                    return escape(match)
 
 
 PRODUCT_SYNTAX_DELIMITER = MultiProductSystem.short_syntax_delimiter

Modified: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/product-ticket-link-tests.txt
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/product-ticket-link-tests.txt?rev=1455454&r1=1455453&r2=1455454&view=diff
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/product-ticket-link-tests.txt
(original)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/product-ticket-link-tests.txt
Tue Mar 12 09:02:46 2013
@@ -90,13 +90,17 @@
 %(link_prefix)s#⁴²
 %(link_prefix)s#1-⁵,42
 %(link_prefix)s#1,³,5,7
+%(link_prefix_quote)s#1"-⁵,42
+%(link_prefix_quote)s#1",³,5,7
 %(link_prefix)s#T²⁰⁴¹
 %(link_prefix)s#trac²⁰⁴¹
 ------------------------------
 <p>
 %(link_prefix)s#⁴²
-<a class="new ticket" href="/ticket/1" title="%(link_title_prefix)sThis is the summary
(new)">#1</a>-⁵,42
-<a class="new ticket" href="/ticket/1" title="%(link_title_prefix)sThis is the summary
(new)">#1</a>,³,5,7
+<a class="new ticket" href="%(path_prefix)s/ticket/1" title="%(link_title_prefix)sThis
is the summary (new)">#1</a>
+<a class="new ticket" href="%(path_prefix)s/ticket/1" title="%(link_title_prefix)sThis
is the summary (new)">#1</a>
+<a class="new ticket" href="%(path_prefix)s/ticket/1" title="%(link_title_prefix)sThis
is the summary (new)">#1</a>-⁵,42
+<a class="new ticket" href="%(path_prefix)s/ticket/1" title="%(link_title_prefix)sThis
is the summary (new)">#1</a>,³,5,7
 %(link_prefix)s#T²⁰⁴¹
 %(link_prefix)s#trac²⁰⁴¹
 </p>



Mime
View raw message