diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2019-03-02 00:17:27 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-02 00:17:27 -0700 |
| commit | bd2a36ed52e86de481ce75ea0fb7b8d2266cf93f (patch) | |
| tree | 5c3e3fc5c83a5e9b5b605af28f33a21be82a0e1f /test | |
| parent | feaa28a5b170ec303ca9b31955acdd8cd2caef43 (diff) | |
resolves #3118 fix crash if stem block is empty (PR #3119)
Diffstat (limited to 'test')
| -rw-r--r-- | test/blocks_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/blocks_test.rb b/test/blocks_test.rb index aab7341d..f1906a37 100644 --- a/test/blocks_test.rb +++ b/test/blocks_test.rb @@ -1561,6 +1561,17 @@ context 'Blocks' do end context 'Math blocks' do + test 'should not crash when converting to HTML if stem block is empty' do + input = <<~'EOS' + [stem] + ++++ + ++++ + EOS + + output = convert_string_to_embedded input + assert_css '.stemblock', output, 1 + end + test 'should add LaTeX math delimiters around latexmath block content' do input = <<~'EOS' [latexmath] @@ -1725,12 +1736,19 @@ context 'Blocks' do ++++ x+b/(2a)<+-sqrt((b^2)/(4a^2)-c/a) ++++ + + [asciimath] + ++++ + ++++ EOS expect = <<~'EOS'.chop <informalequation> <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mi>x</mml:mi><mml:mo>+</mml:mo><mml:mfrac><mml:mi>b</mml:mi><mml:mrow><mml:mn>2</mml:mn><mml:mi>a</mml:mi></mml:mrow></mml:mfrac><mml:mo><</mml:mo><mml:mo>±</mml:mo><mml:msqrt><mml:mrow><mml:mfrac><mml:msup><mml:mi>b</mml:mi><mml:mn>2</mml:mn></mml:msup><mml:mrow><mml:mn>4</mml:mn><mml:msup><mml:mi>a</mml:mi><mml:mn>2</mml:mn></mml:msup></mml:mrow></mml:mfrac><mml:mo>−</mml:mo><mml:mfrac><mml:mi>c</mml:mi><mml:mi>a</mml:mi></mml:mfrac></mml:mrow></mml:msqrt></mml:math> </informalequation> + <informalequation> + <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"></mml:math> + </informalequation> EOS using_memory_logger do |logger| |
