##// END OF EJS Templates
adding more tests for markdown around math
Nicholas Bollweg -
Show More
@@ -122,10 +122,20 b' class TestMarkdown(TestsBase):'
122 ]
122 ]
123 for case in cases:
123 for case in cases:
124 self.assertIn(case, markdown2html(case))
124 self.assertIn(case, markdown2html(case))
125
126 def test_markdown2html_math_mixed(self):
127 """ensure markdown between inline and inline-block math"""
128 case = """The entries of $C$ are given by the exact formula:
129 $$
130 C_{ik} = \sum_{j=1}^n A_{ij} B_{jk}
131 $$
132 but there are many ways to _implement_ this computation. $\approx 2mnp$ flops"""
133 self._try_markdown(markdown2html, case,
134 case.replace("_implement_", "<em>implement</em>"))
125
135
126 def test_markdown2html_math_paragraph(self):
136 def test_markdown2html_math_paragraph(self):
127 """these should all parse without modification"""
137 """these should all parse without modification"""
128 patterns = [
138 cases = [
129 # https://github.com/ipython/ipython/issues/6724
139 # https://github.com/ipython/ipython/issues/6724
130 """Water that is stored in $t$, $s_t$, must equal the storage content of the previous stage,
140 """Water that is stored in $t$, $s_t$, must equal the storage content of the previous stage,
131 $s_{t-1}$, plus a stochastic inflow, $I_t$, minus what is being released in $t$, $r_t$.
141 $s_{t-1}$, plus a stochastic inflow, $I_t$, minus what is being released in $t$, $r_t$.
@@ -151,8 +161,8 b' b}_{i}^{r}(t)=(1-t)\\,{\\bf b}_{i}^{r-1}(t)+t\\,{\\bf b}_{i+1}^{r-1}(t),\\:'
151 i.e. the $i^{th}$"""
161 i.e. the $i^{th}$"""
152 ]
162 ]
153
163
154 for pattern in patterns:
164 for case in cases:
155 self.assertIn(pattern, markdown2html(pattern))
165 self.assertIn(case, markdown2html(case))
156
166
157 @dec.onlyif_cmds_exist('pandoc')
167 @dec.onlyif_cmds_exist('pandoc')
158 def test_markdown2rst(self):
168 def test_markdown2rst(self):
General Comments 0
You need to be logged in to leave comments. Login now