Ticket #1153: shref_fixes_r2399.patch
| File shref_fixes_r2399.patch, 3.8 kB (added by cboos, 3 years ago) |
|---|
-
trac/wiki/tests/wiki-tests.txt
103 103 ============================== 104 104 Add-on to changeset:123: 105 105 Some change. 106 107 106 ticket:1 108 107 This ticket is the first one 108 changeset:123> 109 109 ------------------------------ 110 110 <p> 111 111 Add-on to <a class="missing changeset" href="/changeset/123" rel="nofollow">changeset:123</a>: 112 112 Some change. 113 </p>114 <p>115 113 <a class="missing ticket" href="/ticket/1" rel="nofollow">ticket:1</a> 116 114 This ticket is the first one 115 <a class="missing changeset" href="/changeset/123" rel="nofollow">changeset:123</a>> 117 116 </p> 118 117 ------------------------------ 119 118 Add-on to <a class="missing changeset" href="/changeset/123" rel="nofollow">changeset:123</a>: 120 119 Some change. 121 122 120 <a class="missing ticket" href="/ticket/1" rel="nofollow">ticket:1</a> 123 121 This ticket is the first one 122 <a class="missing changeset" href="/changeset/123" rel="nofollow">changeset:123</a>> 124 123 ============================== 125 124 CamelCase AlabamA ABc AlaBamA FooBar 126 125 ------------------------------ … … 357 356 </p> 358 357 ------------------------------ 359 358 ============================== 359 Test:[[BR]] There should be a line break 360 361 Change:[10] There should be a link to changeset [10] 362 363 Other test:'''bold text''' is not bold 364 ------------------------------ 365 <p> 366 Test:<br /> There should be a line break 367 </p> 368 <p> 369 Change:<a class="missing changeset" href="/changeset/10" rel="nofollow">[10]</a> There should be a link to changeset <a class="missing changeset" href="/changeset/10" rel="nofollow">[10]</a> 370 </p> 371 <p> 372 Other test:<strong>bold text</strong> is not bold 373 </p> 374 ------------------------------ 375 Test: There should be a line break 376 377 Change:<a class="missing changeset" href="/changeset/10" rel="nofollow">[10]</a> There should be a link to changeset <a class="missing changeset" href="/changeset/10" rel="nofollow">[10]</a> 378 379 Other test:<strong>bold text</strong> is not bold 380 ============================== 360 381 {{{ 361 382 Preformatted text. 362 383 }}} -
trac/wiki/tests/formatter.py
83 83 try: 84 84 self.assertEquals(self.correct, v) 85 85 except AssertionError, e: 86 raise AssertionError('%s\n \%s:%s: for the input '86 raise AssertionError('%s\n%s:%s: for the input ' 87 87 '(formatter flavor was "%s")' \ 88 88 % (str(e), self.file, self.line, 89 89 formatter.flavor)) -
trac/wiki/formatter.py
137 137 138 138 QUOTED_STRING = r"'[^']+'|\"[^\"]+\"" 139 139 140 SHREF_TARGET_MIDDLE = r"(?:\|(?=[^|\s])|&(?!lt;)|[^|&\s])" 141 SHREF_TARGET_LAST_CHAR = r"[^|'~_\.,&\s\)\]:?!]" 140 SHREF_TARGET_FIRST = r"[\w/?!#@]" 141 SHREF_TARGET_MIDDLE = r"(?:\|(?=[^|\s])|&(?!lt;|gt;)|[^|&\s])" 142 SHREF_TARGET_LAST = r"[a-zA-Z0-9/=]" # we don't want "_" 142 143 143 144 LHREF_RELATIVE_TARGET = r"[/.][^\s[\]]*" 144 145 … … 163 164 164 165 _post_rules = [ 165 166 # shref corresponds to short TracLinks, i.e. sns:stgt 166 r"(?P<shref>((?P<sns>%s):(?P<stgt>%s|%s *%s)))" \167 r"(?P<shref>((?P<sns>%s):(?P<stgt>%s|%s(?:%s*%s)?)))" \ 167 168 % (LINK_SCHEME, QUOTED_STRING, 168 SHREF_TARGET_ MIDDLE, SHREF_TARGET_LAST_CHAR),169 SHREF_TARGET_FIRST, SHREF_TARGET_MIDDLE, SHREF_TARGET_LAST), 169 170 # lhref corresponds to long TracLinks, i.e. [lns:ltgt label?] 170 171 r"(?P<lhref>\[(?:(?P<lns>%s):(?P<ltgt>%s|[^\]\s]*)|(?P<rel>%s))" 171 172 r"(?:\s+(?P<label>%s|[^\]]+))?\])" \
