Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.8.1, 1.9 M1
-
Component/s: {Unused} Macros & Filters, {Unused} Rendering 2.0
-
Labels:None
-
Tests:Unit
-
Difficulty:Unknown
-
Similar issues:
Description
The code macro fails to format the last line in the following snippet:
{{code language="sh"}}
export X=foo
bar
{{/code}}
I think the xdom.py script needs the following few lines at the end (took this from the Pygments docs):
def format(self, tokensource, outfile): lastval = '' lasttype = None for ttype, value in tokensource: if ttype == lasttype: lastval += value else: if lastval: self.listener.format(lasttype.__str__(), lastval, self.style.style_for_token(lasttype)) lasttype = ttype lastval = value if lastval: self.listener.format(lasttype.__str__(), lastval, self.style.style_for_token(lasttype))
Appreciate it if you could fix this. Thanks in advance!