Modify ↓
#1479 closed enhancement (wontfix)
Automatic links to (English) plural and past tense words in WikiLinks
Reported by: | Owned by: | Jonas Borgström | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | wiki system | Version: | 0.8.1 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
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)
Attachments (0)
Note:
See TracTickets
for help on using tickets.
Please use unified diffs when submitting patches (this is the "-u" option on the diff utility, or use "svn diff" which uses this format by default).
I think that introducing stemming like this isn't a particularly good idea, since it would be quite irritating to work around when it produced an undesired result and would lead to increased difficulty in supporting internationalization.
If you have pages that you want for grammatical usage you can make a page like WikiMacro that says "see WikiMacros", or you can make use of the redirect macro to automatically redirect to the real page.