diff MoinMoin/formatter/text_html.py @ 5284:a83a65fcbb69

bug fix for MoinMoinBugs/LineNumbersWorkingBuggyWithHighlightParser (thanks to Eugene Syromyatnikov for the patch)
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sun, 15 Nov 2009 22:50:47 +0100
parents 12d27670e274
children 44dca95e51ab
line wrap: on
line diff
--- a/MoinMoin/formatter/text_html.py	Sun Nov 15 21:54:56 2009 +0100
+++ b/MoinMoin/formatter/text_html.py	Sun Nov 15 22:50:47 2009 +0100
@@ -859,7 +859,7 @@
 </script>
 """
 
-    def code_area(self, on, code_id, code_type='code', show=0, start=-1, step=-1):
+    def code_area(self, on, code_id, code_type='code', show=0, start=-1, step=-1, msg=None):
         """Creates a formatted code region, with line numbering.
 
         This region is formatted as a <div> with a <pre> inside it.  The
@@ -885,6 +885,12 @@
             # id in here no longer used
             self._code_area_state = [None, show, start, step, start]
 
+            if msg:
+                attr = {'class': 'codemsg'}
+                res.append(self._open('div', attr={'class': 'codemsg'}))
+                res.append(self.text(msg))
+                res.append(self._close('div'))
+
             # Open the code div - using left to right always!
             attr = {'class': 'codearea', 'lang': 'en', 'dir': 'ltr'}
             res.append(self._open('div', attr=attr))