[Trac-tickets] [The Trac Project] #988: Subscript and superscript markup à la MoinMoin
The Trac Project
noreply at edgewall.com
Wed Nov 24 11:16:50 EST 2004
#988: Subscript and superscript markup à la MoinMoin
-------------------------+--------------------------------------------------
Id: 988 | Status: new
Component: wiki | Modified: Wed Nov 24 11:16:49 2004
Severity: enhancement | Milestone: 0.9
Priority: low | Version: devel
Owner: jonas | Reporter: Juanma Barranquero
-------------------------+--------------------------------------------------
A trivial implementation of ^superscript^ and ,,subscript,, markup à la
[http://moinmoin.wikiwikiweb.de/ MoinMoin], from which TracWiki already
draws heavily (and proudly :) [[BR]] Included also a
[source:trunk/trac/tests/wiki-tests.txt wiki-tests.txt] patch, untested.
(''I asked this before, BTW, with no answer: what's the procedure to run
the tests on a Windows environment?'') [[BR]] Anyway, the patch:
{{{
#!text/x-diff
Index: trac/WikiFormatter.py
===================================================================
--- trac/WikiFormatter.py (revision 1100)
+++ trac/WikiFormatter.py (working copy)
@@ -41,2 +41,4 @@
r"""(?P<strike>~~)""",
+ r"""(?P<subscript>,,)""",
+ r"""(?P<superscript>\^)""",
r"""(?P<inlinecode>!?\{\{\{(?P<inline>.*?)\}\}\})""",
@@ -102,2 +104,8 @@
return self.simple_tag_handler('<del>', '</del>')
+
+ def _subscript_formatter(self, match, fullmatch):
+ return self.simple_tag_handler('<sub>', '</sub>')
+
+ def _superscript_formatter(self, match, fullmatch):
+ return self.simple_tag_handler('<sup>', '</sup>')
Index: trac/tests/wiki-tests.txt
===================================================================
--- trac/tests/wiki-tests.txt (revision 1100)
+++ trac/tests/wiki-tests.txt (working copy)
@@ -190 +190,7 @@
</p>
+==============================
+^superscript^, ,,subscript,,, normal.
+------------------------------
+<p>
+<sup>superscript</sup>, <sub>subscript</sub>, normal.
+</p>
}}}
--
Ticket URL: <http://projects.edgewall.com/trac/ticket/988>
The Trac Project <>
More information about the Trac-Tickets
mailing list