From b84afae9c4e1ac595175cd75212a5b14f103ee33 2013-03-09 19:29:30 From: Matthias BUSSONNIER Date: 2013-03-09 19:29:30 Subject: [PATCH] fix latex_transformer and add test --- 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