Changes between Version 3 and Version 4 of TracDev/IWikiSyntaxProviderExample
- Timestamp:
- Sep 11, 2010, 11:41:13 AM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracDev/IWikiSyntaxProviderExample
v3 v4 135 135 {{{ 136 136 #!python 137 # encoding: utf-8137 # -*- coding: utf-8 -*- 138 138 """ 139 139 WikiSyntaxProviderTest.py … … 143 143 """ 144 144 145 from genshi.builder import tag 146 145 147 from trac.core import * 146 148 from trac.wiki import IWikiSyntaxProvider 147 from genshi.builder import tag 149 148 150 149 151 class WikiSyntaxProviderTest(Component): 150 '''This is a test Component to demonstrate the use of the IWikiSyntaxProvider Interface of Trac.''' 152 """This is a test Component to demonstrate the use of the 153 IWikiSyntaxProvider Interface of Trac.""" 151 154 implements(IWikiSyntaxProvider) 152 155 … … 157 160 158 161 def get_wiki_syntax(self): 159 #group numbers dont work, why? Must use group names inside the regex. 160 yield ( r'\?(?P<domain>[tmw])_(?P<searchword>.+?)\?', self._format_regex_link) 162 # Note that group numbers don't work as the following is only a regexp 163 # fragment which will be part of a larger regexp, therefore one must 164 # use group names, with reasonably unique names 165 yield (r'\?(?P<domain>[tmw])_(?P<searchword>.+?)\?', 166 self._format_regex_link) 161 167 162 168 def _format_regex_link(self, formatter, ns, match):