##// END OF EJS Templates
adding tests from jupyter/nbviewer#420
Nicholas Bollweg -
Show More
@@ -124,11 +124,35 b' class TestMarkdown(TestsBase):'
124 self.assertIn(case, markdown2html(case))
124 self.assertIn(case, markdown2html(case))
125
125
126 def test_markdown2html_math_paragraph(self):
126 def test_markdown2html_math_paragraph(self):
127 # https://github.com/ipython/ipython/issues/6724
127 """these should all parse without modification"""
128 a = """Water that is stored in $t$, $s_t$, must equal the storage content of the previous stage,
128 patterns = [
129 # 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,
129 $s_{t-1}$, plus a stochastic inflow, $I_t$, minus what is being released in $t$, $r_t$.
131 $s_{t-1}$, plus a stochastic inflow, $I_t$, minus what is being released in $t$, $r_t$.
130 With $s_0$ defined as the initial storage content in $t=1$, we have"""
132 With $s_0$ defined as the initial storage content in $t=1$, we have""",
131 self.assertIn(a, markdown2html(a))
133 # https://github.com/jupyter/nbviewer/issues/420
134 """$C_{ik}$
135 $$
136 C_{ik} = \sum_{j=1}
137 $$
138 $C_{ik}$""",
139 """$m$
140 $$
141 C = \begin{pmatrix}
142 0 & 0 & 0 & \cdots & 0 & 0 & -c_0 \\
143 0 & 0 & 0 & \cdots & 0 & 1 & -c_{m-1}
144 \end{pmatrix}
145 $$
146 $x^m$""",
147 """$r=\overline{1,n}$
148 $$ {\bf
149 b}_{i}^{r}(t)=(1-t)\,{\bf b}_{i}^{r-1}(t)+t\,{\bf b}_{i+1}^{r-1}(t),\:
150 i=\overline{0,n-r}, $$
151 i.e. the $i^{th}$"""
152 ]
153
154 for pattern in patterns:
155 self.assertIn(pattern, markdown2html(pattern))
132
156
133 @dec.onlyif_cmds_exist('pandoc')
157 @dec.onlyif_cmds_exist('pandoc')
134 def test_markdown2rst(self):
158 def test_markdown2rst(self):
General Comments 0
You need to be logged in to leave comments. Login now