changeset 217:98df82a31b87

Added strike() to non HTML formatters. PLEASE REVIEW the xml_docbook FORMATTER! imported from: moin--main--1.5--patch-220
author Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
date Thu, 17 Nov 2005 10:52:43 +0000
parents 5654512900ca
children 4354469a060d
files MoinMoin/formatter/base.py MoinMoin/formatter/dom_xml.py MoinMoin/formatter/pagelinks.py MoinMoin/formatter/text_plain.py MoinMoin/formatter/text_xml.py MoinMoin/formatter/xml_docbook.py
diffstat 6 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/formatter/base.py	Wed Nov 16 19:02:53 2005 +0000
+++ b/MoinMoin/formatter/base.py	Thu Nov 17 10:52:43 2005 +0000
@@ -203,6 +203,9 @@
     def sub(self, on):
         raise NotImplementedError
 
+    def strike(self, on):
+        raise NotImplementedError
+
     def code(self, on, **kw):
         raise NotImplementedError
 
--- a/MoinMoin/formatter/dom_xml.py	Wed Nov 16 19:02:53 2005 +0000
+++ b/MoinMoin/formatter/dom_xml.py	Thu Nov 17 10:52:43 2005 +0000
@@ -23,7 +23,7 @@
 
     hardspace = ' '
 
-    format_tags = ['b', 'em', 'highlight', 'sup', 'sub', 'code', 'u']
+    format_tags = ['b', 'em', 'highlight', 'sup', 'sub', 'strike', 'code', 'u']
 
     unbreakables = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6',
                     'p', 'ol', 'ul', 'li', 'pre', 'a',
@@ -286,6 +286,9 @@
     def sub(self, on):
         return self._set_tag('sub', on)
 
+    def strike(self, on):
+        return self._set_tag('strike', on)
+
     def code(self, on, **kw):
         return self._set_tag('code', on)
 
--- a/MoinMoin/formatter/pagelinks.py	Wed Nov 16 19:02:53 2005 +0000
+++ b/MoinMoin/formatter/pagelinks.py	Thu Nov 17 10:52:43 2005 +0000
@@ -32,6 +32,7 @@
     highlight = null
     sup = null
     sub = null
+    strike = null
     code = null
     preformatted = null
     small = null
--- a/MoinMoin/formatter/text_plain.py	Wed Nov 16 19:02:53 2005 +0000
+++ b/MoinMoin/formatter/text_plain.py	Thu Nov 17 10:52:43 2005 +0000
@@ -142,6 +142,9 @@
     def sub(self, on):
         return u'_'
 
+    def sub(self, on):
+        return u'__'
+
     def code(self, on, **kw):
         #return [unichr(0x60), unichr(0xb4)][not on]
         return u"'" # avoid high-ascii
--- a/MoinMoin/formatter/text_xml.py	Wed Nov 16 19:02:53 2005 +0000
+++ b/MoinMoin/formatter/text_xml.py	Thu Nov 17 10:52:43 2005 +0000
@@ -123,6 +123,9 @@
     def sub(self, on):
         return ['<sub>', '</sub>'][not on]
 
+    def strike(self, on):
+        return ['<strike>', '</strike>'][not on]
+
     def preformatted(self, on):
         FormatterBase.preformatted(self, on)
         result = ''
--- a/MoinMoin/formatter/xml_docbook.py	Wed Nov 16 19:02:53 2005 +0000
+++ b/MoinMoin/formatter/xml_docbook.py	Thu Nov 17 10:52:43 2005 +0000
@@ -287,6 +287,10 @@
     def sub(self, on):
         return self._handleFormatting("subscript", on)
 
+    def strike(self, on):
+        return self._handleFormatting("emphasis", on,
+                                      (('role','strikethrough'), ))
+
     def code(self, on):
         return self._handleFormatting("code", on)