Fix escaping of carets by overriding escape pattern.
This commit is contained in:
parent
63324ca824
commit
63309cbc82
1 changed files with 4 additions and 0 deletions
|
@ -138,6 +138,10 @@ class VoussoirInlineGrammar(mistune.InlineGrammar):
|
|||
# \- for --
|
||||
# \^ for superscript
|
||||
text = re.compile(r'^[\s\S]+?(?=[\\<!\[_*`~\-\^\/]|https?:\/\/| {2,}\n|$)')
|
||||
# This `escape` override is first taken from the mistune source.
|
||||
# My additions so far are:
|
||||
# ^ for escaping supers
|
||||
escape = re.compile(r'^\\([\\`*\^{}\[\]()#+\-.!_>~|])')
|
||||
|
||||
class VoussoirInline(mistune.InlineLexer):
|
||||
default_rules = copy.copy(mistune.InlineLexer.default_rules)
|
||||
|
|
Loading…
Reference in a new issue