Edgewall Software
Modify

Ticket #322 (closed defect: fixed)

Opened 8 years ago

Last modified 8 years ago

Incorrect linking of partial CamelCase words

Reported by: cmlenz@… Owned by: jonas
Priority: normal Milestone: 0.7
Component: wiki system Version: 0.6.1
Severity: normal Keywords:
Cc:
Release Notes:
API Changes:

Description

The support for auto-linking CamelCase words is incorrect: when I enter a word such as AlaBamA, it should not be linked at all. However, in 0.6.1 and 0.7-dev, the 'AlaBam?' part is linked, while the trailing 'A' is left as is.

The correct behaviour would be to not link the word at all, I think.

Attachments

Change History

comment:1 Changed 8 years ago by cmlenz@…

Here's a patch to the wiki test suite that demonstrates the problem:

Index: trac/tests/wiki-tests.txt
===================================================================
--- trac/tests/wiki-tests.txt	(revision 474)
+++ trac/tests/wiki-tests.txt	(working copy)
@@ -55,3 +55,9 @@
 <a href="/ticket/1">ticket 1</a>, <a href="/changeset/1">changeset 1</a>, <a href="/report/1">report 1</a>, 
 <a href="/browser/foo/bar">source foo/bar</a>, <a href="http://www.edgewall.com/">edgewall</a>
 </p>
+==============================
+CamelCase AlabamA ABc AlaBamA
+------------------------------
+<p>
+<a class="missing" href="/wiki/CamelCase">CamelCase?</a> AlabamA ABc AlaBamA
+</p>
Index: trac/tests/wiki.py
===================================================================
--- trac/tests/wiki.py	(revision 474)
+++ trac/tests/wiki.py	(working copy)
@@ -16,12 +16,13 @@
         class Environment:
             def __init__(self):
                 self.href = Href.Href('/')
+		self._wiki_pages = {}
                 
         out = StringIO.StringIO()
         Formatter(None, Environment()).format(self.input, out)
         if out.getvalue() != self.correct:
-            print "'%s' != '%s'" % (out.getvalue(), correct)
-            assert correct == out.getvalue()
+            print "'%s' != '%s'" % (out.getvalue(), self.correct)
+            assert self.correct == out.getvalue()
 
 def suite():
     suite = unittest.TestSuite()

I hope this comes out right ;-)

comment:2 Changed 8 years ago by jonas

  • Milestone set to 0.7
  • Status changed from new to assigned

comment:3 Changed 8 years ago by jonas

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in [477].

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from jonas. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.