##// END OF EJS Templates
fix latex_transformer and add test
Matthias BUSSONNIER -
Show More
@@ -63,7 +63,7 b' def remove_math_space(text):'
63 math_lines += 1
63 math_lines += 1
64 if math_lines > 1:
64 if math_lines > 1:
65 within_math = False
65 within_math = False
66 ptext = ptext+text[math_start_index:index]+"\n"
66 ptext = ptext+text[math_start_index:index]
67
67
68 # Remember the last character so we can easily watch
68 # Remember the last character so we can easily watch
69 # for backslashes
69 # for backslashes
@@ -11,6 +11,15 b' def test_space(input, reference):'
11
11
12
12
13 def test_evens():
13 def test_evens():
14 unchanged = [
15 """
16 you should be able to type
17
18 $ a single dollar and go to the line
19
20 it shouldn't be transformed.
21 """
22 ]
14 references = [
23 references = [
15 ('$e$','$e$'),
24 ('$e$','$e$'),
16 ('$ e $','$e$'),
25 ('$ e $','$e$'),
@@ -19,7 +28,11 b' def test_evens():'
19 ('xxx$e^i $yyy','xxx$e^i$yyy'),
28 ('xxx$e^i $yyy','xxx$e^i$yyy'),
20 ('xxx$ e^i$yyy','xxx$e^i$yyy'),
29 ('xxx$ e^i$yyy','xxx$e^i$yyy'),
21 ('\$ e $ e $','\$ e $e$'),
30 ('\$ e $ e $','\$ e $e$'),
31 ('',''),
22 ]
32 ]
23
33
24 for k,v in references :
34 for k,v in references :
25 yield test_space, k,v
35 yield test_space, k,v
36
37 for unch in unchanged :
38 yield test_space, unch, unch
General Comments 0
You need to be logged in to leave comments. Login now