Modify ↓
Ticket #912 (closed defect: fixed)
Opened 8 years ago
Last modified 8 years ago
Detect end of WikiName on ; ! ? } ] symbols
| Reported by: | Juanma Barranquero | Owned by: | jonas |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.8 |
| Component: | general | Version: | devel |
| Severity: | minor | Keywords: | patch |
| Cc: | |||
| Release Notes: | |||
| API 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
Change History
comment:1 Changed 8 years ago by jonas
- Status changed from new to assigned
comment:2 Changed 8 years ago by jonas
- Resolution set to fixed
- Status changed from assigned to closed
Note: See
TracTickets for help on using
tickets.



Fixed in [1045].