##// END OF EJS Templates
Backport PR #6878: Update pygments monkeypatch for compatibility with Pygments 2.0...
Min RK -
Show More
@@ -12,6 +12,11 b" def get_tokens_unprocessed(self, text, stack=('root',)):"
12 12 """ Split ``text`` into (tokentype, text) pairs.
13 13
14 14 Monkeypatched to store the final stack on the object itself.
15
16 The `text` parameter this gets passed is only the current line, so to
17 highlight things like multiline strings correctly, we need to retrieve
18 the state from the previous line (this is done in PygmentsHighlighter,
19 below), and use it to continue processing the current line.
15 20 """
16 21 pos = 0
17 22 tokendefs = self._tokens
@@ -24,6 +29,7 b" def get_tokens_unprocessed(self, text, stack=('root',)):"
24 29 for rexmatch, action, new_state in statetokens:
25 30 m = rexmatch(text, pos)
26 31 if m:
32 if action is not None:
27 33 if type(action) is _TokenType:
28 34 yield pos, action, m.group()
29 35 else:
General Comments 0
You need to be logged in to leave comments. Login now