Edgewall Software
Modify

Opened 20 years ago

Closed 20 years ago

Last modified 18 years ago

#1479 closed enhancement (wontfix)

Automatic links to (English) plural and past tense words in WikiLinks

Reported by: peter@… 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)

Change History (1)

comment:1 by Matthew Good, 20 years ago

Resolution: wontfix
Status: newclosed

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.

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.