Edgewall Software
Modify

Opened 20 years ago

Closed 20 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

     
    4747              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|[.,;:!?\)}\]]))""",
    4949              r"""(?P<fancylink>!?\[(?P<fancyurl>([a-z]+:[^ ]+)) (?P<linkname>.*?)\])"""]
  • trac/tests/wiki-tests.txt

     
    156156</p>
     157==============================
     158SandBox 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 Jonas Borgström, 20 years ago

Status: newassigned

comment:2 by Jonas Borgström, 20 years ago

Resolution: fixed
Status: assignedclosed

Fixed in [1045].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.