Details
-
Bug
-
Resolution: Fixed
-
Minor
-
1.8.1, 1.9 M1
-
None
-
Unit
-
Unknown
-
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!