Commits

Anonymous committed fd7f1c8

Applied patch by Immanuel Scholz <immanuel.scholz@tu-dresden.de> to allow
Latex style '$$' syntax in wiki pages.

Comments (0)

Files changed (1)

tracmath/tracmath.py

 
 from trac.core import *
 from trac.wiki.api import IWikiMacroProvider
+from trac.wiki.api import IWikiSyntaxProvider
 from trac.mimeview.api import IHTMLPreviewRenderer, MIME_MAP
 from trac.web import IRequestHandler
 from trac.util import escape
             ]
 
 class TracMathPlugin(Component):
-    implements(IWikiMacroProvider, IHTMLPreviewRenderer, IRequestHandler)
+    implements(IWikiMacroProvider, IHTMLPreviewRenderer, IRequestHandler, IWikiSyntaxProvider)
 
     def __init__(self):
         self.load_config()
         self.log.error(msg)
         return buf
 
+    # IWikiSyntaxProvider methods
+    def get_wiki_syntax(self):
+        def format(formatter, ns, match):
+            return self.internal_render(formatter.req,'latex',match.group(0))
+        yield (r"\$[^$]+\$", format)
+
+    def get_link_resolvers(self):
+        return []
+
     # IWikiMacroProvider methods
     def get_macros(self):
         yield 'latex'