Ticket #2029: external_link_fix.patch
| File external_link_fix.patch, 3.0 KB (added by cboos, 7 years ago) |
|---|
-
tests/wiki-tests.txt
61 61 </p> 62 62 ============================== 63 63 ticket:1, changeset:1, report:1, source:foo/bar 64 65 Issue [ticket:1], CS[changeset:1], Listing [report:1], File [source:foo/bar] 64 66 ------------------------------ 65 67 <p> 66 68 <a class="missing ticket" href="/ticket/1" rel="nofollow">ticket:1</a>, <a class="missing changeset" href="/changeset/1" rel="nofollow">changeset:1</a>, <a class="report" href="/report/1">report:1</a>, <a class="source" href="/browser/foo/bar">source:foo/bar</a> 67 69 </p> 70 <p> 71 Issue <a class="missing ticket" href="/ticket/1" rel="nofollow">1</a>, CS<a class="missing changeset" href="/changeset/1" rel="nofollow">1</a>, Listing <a class="report" href="/report/1">1</a>, File <a class="source" href="/browser/foo/bar">foo/bar</a> 72 </p> 68 73 ============================== 69 74 [ticket:1 ticket 1], [changeset:1 changeset 1], [report:1 report 1], 70 75 [source:foo/bar source foo/bar], [http://www.edgewall.com/ edgewall] … … 135 140 wiki:Foo%20Bar wiki:Foo%20Bar#baz 136 141 137 142 [wiki:Foo%20Bar Foo Bar] [wiki:Foo%20Bar#baz Foo Bar] 143 144 [wiki:Argv "*argv[] versus **argv"] 138 145 ------------------------------ 139 146 <p> 140 147 <a class="missing wiki" href="/wiki/WikiStart" rel="nofollow">Foo?</a> <a class="ext-link" href="http://www.edgewall.com/"><span class="icon"></span>Edgewall</a> … … 145 152 <p> 146 153 <a class="missing wiki" href="/wiki/Foo%20Bar" rel="nofollow">Foo Bar?</a> <a class="missing wiki" href="/wiki/Foo%20Bar#baz" rel="nofollow">Foo Bar?</a> 147 154 </p> 155 <p> 156 <a class="missing wiki" href="/wiki/Argv" rel="nofollow">*argv[] versus **argv?</a> 157 </p> 148 158 ============================== 149 159 foo (FooBar) 150 160 -
formatter.py
155 155 (r"(?P<lhref>!?\[(?:(?P<lns>%s):" % LINK_SCHEME + 156 156 r"(?P<ltgt>'[^']+'|\"[^\"]+\"|[^\] ]+)" 157 157 r"|(?P<rel>[/.][^ [\]]*))" 158 r"(?: (?P<label> .*?))?\])"),158 r"(?: (?P<label>'[^']+'|\"[^\"]+\"|[^\]]+))?\])"), 159 159 (r"(?P<macro>!?\[\[(?P<macroname>[\w/+-]+)" 160 160 r"(\]\]|\((?P<macroargs>.*?)\)\]\]))"), 161 161 r"(?P<heading>^\s*(?P<hdepth>=+)\s.*\s(?P=hdepth)\s*$)", … … 289 289 target = fullmatch.group('ltgt') 290 290 if target and target[0] in "'\"": 291 291 target = target[1:-1] 292 label = fullmatch.group('label') or target 292 label = fullmatch.group('label') 293 if not label: 294 if target: 295 label = target.startswith('//') and ns+':'+target or target 296 else: 297 label = ns 298 if label and label[0] in "'\"": 299 label = label[1:-1] 293 300 rel = fullmatch.group('rel') 294 301 if rel: 295 302 return self._make_relative_link(rel, label or rel)
