[Trac-tickets] [The Trac Project] #1479: Automatic links to
(English) plural and past tense words in WikiLinks
The Trac Project
noreply at edgewall.com
Mon Apr 25 14:49:49 EDT 2005
#1479: Automatic links to (English) plural and past tense words in WikiLinks
-------------------------+--------------------------------------------------
Id: 1479 | Status: new
Component: wiki | Modified: Mon Apr 25 14:49:44 2005
Severity: enhancement | Milestone:
Priority: normal | Version: 0.8.1
Owner: jonas | Reporter: peter at OhioLINK.edu
-------------------------+--------------------------------------------------
After changing sentence structure and/or creating manual wiki links a
dozen times, I hacked the code to account for plurals and past tense words
in creating automatic wiki links. The patch, submitted for your
consideration, is here:
{{{
# diff WikiFormatter.py.dist WikiFormatter.py
207c207,213
< if not self.env._wiki_pages.has_key(match):
---
> if self.env._wiki_pages.has_key(match):
> return '<a href="%s">%s</a>' % (self._href.wiki(match),
match)
> elif match.endswith('s') and
self.env._wiki_pages.has_key(match.rstrip('s')):
> return '<a href="%s">%s</a>' %
(self._href.wiki(match.rstrip('s')), match)
> elif match.endswith('d') and
self.env._wiki_pages.has_key(match.rstrip('d')):
> return '<a href="%s">%s</a>' %
(self._href.wiki(match.rstrip('d')), match)
> else:
210,211d215
< else:
< return '<a href="%s">%s</a>' % (self._href.wiki(match),
match)
}}}
--
Ticket URL: <http://projects.edgewall.com/trac/ticket/1479>
The Trac Project <>
More information about the Trac-Tickets
mailing list