diff --git a/converters/latex_transformer.py b/converters/latex_transformer.py index 7db8f96..12f1c5d 100644 --- a/converters/latex_transformer.py +++ b/converters/latex_transformer.py @@ -63,7 +63,7 @@ def remove_math_space(text): math_lines += 1 if math_lines > 1: within_math = False - ptext = ptext+text[math_start_index:index]+"\n" + ptext = ptext+text[math_start_index:index] # Remember the last character so we can easily watch # for backslashes diff --git a/tests/test_transformers.py b/tests/test_transformers.py index d0ecc9c..de0c14b 100644 --- a/tests/test_transformers.py +++ b/tests/test_transformers.py @@ -11,6 +11,15 @@ def test_space(input, reference): def test_evens(): + unchanged = [ + """ + you should be able to type + + $ a single dollar and go to the line + + it shouldn't be transformed. + """ + ] references = [ ('$e$','$e$'), ('$ e $','$e$'), @@ -19,7 +28,11 @@ def test_evens(): ('xxx$e^i $yyy','xxx$e^i$yyy'), ('xxx$ e^i$yyy','xxx$e^i$yyy'), ('\$ e $ e $','\$ e $e$'), + ('',''), ] for k,v in references : yield test_space, k,v + + for unch in unchanged : + yield test_space, unch, unch