﻿id,summary,reporter,owner,description,type,status,priority,component,severity,resolution,keywords,cc,release
5903,Enhanced detection of links,anonymous,rjollos,"In the current version (released on 08/19/08) are not detected correctly all types of links.

E.g. following links are not currently detected:

{{{
[wiki:""Name of the page""]
NameOfThePage
}}}

It will be nice if future versions of the macro contain detection of these two additional link types. In our case we have a lot of these links and without patch macro is not so useful.

For my purpose I have modified existing source code (only for TRAC 0.11) and changed following lines.

Original source code:

{{{
if thispage:
      #sql += 'AND (w1.text LIKE \'%%[wiki:%s %%\' ' % (to_unicode(thispage, ""utf-8"").encode (""utf-8""))
      sql += 'AND (w1.text LIKE \'%%[wiki:%s %%\' ' % thispage
      sql += 'OR w1.text LIKE \'%%[wiki:%s]%%\')' % thispage
      #sql += 'OR w1.text LIKE \'%%[wiki:%s]%%\')' % (to_unicode (thispage, ""utf-8"").encode (""utf-8""))
}}}

My changes:

{{{
      #sql += 'AND (w1.text LIKE \'%%[wiki:%s %%\' ' % (to_unicode(thispage, ""utf-8"").encode (""utf-8""))
      sql += 'AND (w1.text LIKE \'%%[wiki:%s %%\' ' % thispage
      sql += 'OR w1.text LIKE \'%%[wiki:%s]%%\'' % thispage
      sql += 'OR w1.text LIKE \'%%[wiki:""%s""]%%\'' % thispage
      sql += 'OR w1.text LIKE \'%%%s%%\')' % thispage
      #sql += 'OR w1.text LIKE \'%%[wiki:%s]%%\')' % (to_unicode (thispage, ""utf-8"").encode (""utf-8""))
}}}

Whole script is in the attachment.

Thanks a lot for incorporating these changes.
",defect,new,normal,BackLinksMacro,normal,,,,0.11
