comparison 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
comparison
equal deleted inserted replaced
5283:f68e18305d05 5284:a83a65fcbb69
857 return false; 857 return false;
858 } 858 }
859 </script> 859 </script>
860 """ 860 """
861 861
862 def code_area(self, on, code_id, code_type='code', show=0, start=-1, step=-1): 862 def code_area(self, on, code_id, code_type='code', show=0, start=-1, step=-1, msg=None):
863 """Creates a formatted code region, with line numbering. 863 """Creates a formatted code region, with line numbering.
864 864
865 This region is formatted as a <div> with a <pre> inside it. The 865 This region is formatted as a <div> with a <pre> inside it. The
866 code_id argument is assigned to the 'id' of the div element, and 866 code_id argument is assigned to the 'id' of the div element, and
867 must be unique within the document. The show, start, and step are 867 must be unique within the document. The show, start, and step are
882 # Open a code area 882 # Open a code area
883 self._in_code_area = 1 883 self._in_code_area = 1
884 self._in_code_line = 0 884 self._in_code_line = 0
885 # id in here no longer used 885 # id in here no longer used
886 self._code_area_state = [None, show, start, step, start] 886 self._code_area_state = [None, show, start, step, start]
887
888 if msg:
889 attr = {'class': 'codemsg'}
890 res.append(self._open('div', attr={'class': 'codemsg'}))
891 res.append(self.text(msg))
892 res.append(self._close('div'))
887 893
888 # Open the code div - using left to right always! 894 # Open the code div - using left to right always!
889 attr = {'class': 'codearea', 'lang': 'en', 'dir': 'ltr'} 895 attr = {'class': 'codearea', 'lang': 'en', 'dir': 'ltr'}
890 res.append(self._open('div', attr=attr)) 896 res.append(self._open('div', attr=attr))
891 897