Modify ↓
Opened 21 years ago
Closed 21 years ago
#912 closed defect (fixed)
Detect end of WikiName on ; ! ? } ] symbols
| Reported by: | Juanma Barranquero | Owned by: | Jonas Borgström |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.8 |
| Component: | general | Version: | devel |
| Severity: | minor | Keywords: | patch |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
Currently, ".", ",", ":" and ")" finish parsing a WikiName, but ";", "?", "!!", ")" and "}" do not, even if all of them, except perhaps "}", are usual in normal writing and likely to follow a valid WikiName.
The attached patch to WikiFormatting.py makes them valid as WikiName "finishers". I've also patched the test, though I didn't run it (I'm not entirely sure what's the usual way to run the tests).
-
trac/WikiFormatter.py
47 47 r"""(?P<modulehref>!?((?P<modulename>bug|ticket|browser|source|repos|report|changeset|wiki|milestone|search):(?P<moduleargs>("(.*?)"|'(.*?)')|([^ ]*[^\., \)]))))""", 48 r"""(?P<wikilink>!?(^|(?<=[^A-Za-z]))[A-Z][a-z]+(?:[A-Z][a-z]*[a-z/])+(?=\Z|\s| ,|\.|:|\)))""",48 r"""(?P<wikilink>!?(^|(?<=[^A-Za-z]))[A-Z][a-z]+(?:[A-Z][a-z]*[a-z/])+(?=\Z|\s|[.,;:!?\)}\]]))""", 49 49 r"""(?P<fancylink>!?\[(?P<fancyurl>([a-z]+:[^ ]+)) (?P<linkname>.*?)\])"""] -
trac/tests/wiki-tests.txt
156 156 </p> 157 ============================== 158 SandBox SandBox, SandBox; SandBox: SandBox. SandBox? SandBox! (SandBox) {SandBox} [SandBox] 159 ------------------------------ 160 <p> 161 <a href="/trac/wiki/SandBox">SandBox</a> <a href="/trac/wiki/SandBox">SandBox</a>, <a href="/trac/wiki/SandBox">SandBox</a>; <a href="/trac/wiki/SandBox">SandBox</a>: <a href="/trac/wiki/SandBox">SandBox</a>. <a href="/trac/wiki/SandBox">SandBox</a>? <a href="/trac/wiki/SandBox">SandBox</a>! (<a href="/trac/wiki/SandBox">SandBox</a>) {<a href="/trac/wiki/SandBox">SandBox</a>} [<a href="/trac/wiki/SandBox">SandBox</a>] 162 </p>
Attachments (0)
Change History (2)
comment:1 by , 21 years ago
| Status: | new → assigned |
|---|
comment:2 by , 21 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.



Fixed in [1045].