Multiline math #717
The block lexer/parser was splitting equations like this $$ x = 2 $$ So the inline lexer/parser was never seeing the whole equation, and it wasn't getting properly rendered. This fixes such breaking by adding a block-level lexer/parser to the LaTeX equations written as either $$...$$ or \\[...\\] The inline "block math" parsing code was kept as is, since the above equation could have been part of a paragraph like "$$x = 2$$" to keep the compatibility with Jupyter Notebook rendering engine (and because there's a test enforcing that behavior)
These are encoded as strings now, not raw strings. Additionally they are implicitly joined, not in triple quotes. If you look at the other examples, except for the last example, this style is more in keeping with the rest of our tests. This should be functionally identical in practice to the raw triple quoted string with literal new lines. Honestly, I was doing it to keep the style consistent with what was already there. There were reasons that I originally went along with that style long ago, because of some 3rd party regex tools (e.g., regex101.com). I'd need to reevaluate the state of the art to determine if those issues were still constraints & applicable. If you'd prefer them to be multi line we should make all the old multi-line strings into literal multi-line strings and make that our uniform style for those tests.…
On Sat, Dec 9, 2017 at 04:16 Thomas Kluyver ***@***.***> wrote: ***@***.**** commented on this pull request. ------------------------------ In nbconvert/filters/tests/test_markdown.py <#717 (comment)>: > @@ -137,6 +137,18 @@ def test_markdown2html_math(self): "$$a<b&b<lt$$", "$$a<b<b>a;a-b<0$$", "$$<k'>$$", + ("$$x\\n" Shouldn't these be actual newlines, rather than making a string with a backslash followed by a lowercase n? You don't type \n in markdown, as far as I'm aware. What am I missing? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#717 (review)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ACXg6Gxl6a3zljwBMeSJ2Z0pj5YD-nZEks5s-noOgaJpZM4Q4Wrv> .
I'm happy with implicitly joined strings like this. But I think they should be e.g.
See e.g. line 129 in the same file for an example of what I mean.