Changeset 3198 for autolinksplugin
- Timestamp:
- 02/08/08 11:18:29 (10 months ago)
- Files:
-
- autolinksplugin/0.10/autolinks/autolinks.py (modified) (2 diffs)
- autolinksplugin/0.10/setup.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
autolinksplugin/0.10/autolinks/autolinks.py
r2758 r3198 17 17 from trac.wiki.formatter import Formatter 18 18 wiki_page_name = ( 19 r"(([A-Z]+[a-z]{2,})|([A-Z]{3,} ))"19 r"(([A-Z]+[a-z]{2,})|([A-Z]{3,}s?))" 20 20 r"(?:#[\w:](?<!\d)(?:[\w:.-]*[\w-])?)?" # optional fragment id 21 21 r"(?=:(?:\Z|\s)|[^:a-zA-Z]|\s|\Z)" # what should follow it … … 34 34 # copied and modified from trac/wiki/api.py 35 35 page, query, fragment = formatter.split_link(page) 36 href = formatter.href.wiki(page) + fragment 37 if not self.wikisys.has_page(page): 36 link = False 37 if self.wikisys.has_page(page): 38 link = True 39 elif page[-1] == 's' and self.wikisys.has_page(page[:-1]): 40 # if the page name ends in 's', see if there is a wiki page with the same name minus the 's' 41 # if there is, it will be linked 42 page = page[:-1] 43 link = True 44 45 if link: 46 href = formatter.href.wiki(page) + fragment 47 return html.A(label, href=href, class_='wiki') 48 else: 38 49 return label 39 50 # use the following line instead to link pages even if a wiki page 40 51 # by that name does not exist yet 41 52 #return html.A(label+'?', href=href, class_='missing wiki', rel='nofollow') 42 else:43 return html.A(label, href=href, class_='wiki')44 53 autolinksplugin/0.10/setup.py
r2758 r3198 14 14 license = "BSD", 15 15 keywords = "trac plugin wiki proper case acronym links", 16 url = " ",16 url = "http://trac-hacks.org/wiki/AutoLinksPlugin", 17 17 classifiers = [ 18 18 'Framework :: Trac',
