Show More
@@ -84,14 +84,14 b' class MathBlockLexer(mistune.BlockLexer):' | |||||
84 | rules = MathBlockGrammar() |
|
84 | rules = MathBlockGrammar() | |
85 | super(MathBlockLexer, self).__init__(rules, **kwargs) |
|
85 | super(MathBlockLexer, self).__init__(rules, **kwargs) | |
86 |
|
86 | |||
87 |
def |
|
87 | def output_block_math(self, m): | |
88 | """Parse a $$math$$ block""" |
|
88 | """Parse a $$math$$ block""" | |
89 | self.tokens.append({ |
|
89 | self.tokens.append({ | |
90 | 'type': 'block_math', |
|
90 | 'type': 'block_math', | |
91 | 'text': m.group(1) |
|
91 | 'text': m.group(1) | |
92 | }) |
|
92 | }) | |
93 |
|
93 | |||
94 |
def |
|
94 | def output_latex_environment(self, m): | |
95 | self.tokens.append({ |
|
95 | self.tokens.append({ | |
96 | 'type': 'latex_environment', |
|
96 | 'type': 'latex_environment', | |
97 | 'name': m.group(1), |
|
97 | 'name': m.group(1), | |
@@ -124,10 +124,10 b' class MarkdownWithMath(mistune.Markdown):' | |||||
124 | kwargs['block'] = MathBlockLexer |
|
124 | kwargs['block'] = MathBlockLexer | |
125 | super(MarkdownWithMath, self).__init__(renderer, **kwargs) |
|
125 | super(MarkdownWithMath, self).__init__(renderer, **kwargs) | |
126 |
|
126 | |||
127 |
def |
|
127 | def output_block_math(self): | |
128 | return self.renderer.block_math(self.token['text']) |
|
128 | return self.renderer.block_math(self.token['text']) | |
129 |
|
129 | |||
130 |
def |
|
130 | def output_latex_environment(self): | |
131 | return self.renderer.latex_environment(self.token['name'], self.token['text']) |
|
131 | return self.renderer.latex_environment(self.token['name'], self.token['text']) | |
132 |
|
132 | |||
133 | @undoc |
|
133 | @undoc |
General Comments 0
You need to be logged in to leave comments.
Login now