File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -185,3 +185,9 @@ def test_four_apostrophe_to_three_to_two():
185
185
assert [repr (i ) for i in parse ("''''a''b" ).get_bolds_and_italics ()] == [
186
186
"Italic(\" ''a''\" )"
187
187
]
188
+
189
+
190
+ def test_comment_at_end_of_four ():
191
+ assert [
192
+ repr (i ) for i in parse ("''''<!---->a''b" ).get_bolds_and_italics ()
193
+ ] == ["Italic(\" ''<!---->a''\" )" ]
Original file line number Diff line number Diff line change @@ -1071,12 +1071,12 @@ def repl(m) -> bytes:
1071
1071
if n == 4 : # four apostrophes -> hide the first one
1072
1072
s = starts [1 ]
1073
1073
append_bold_start (s )
1074
- return b'_' * (s - starts [0 ]) + m .string [s : starts [ - 1 ] + 1 ]
1074
+ return b'_' * (s - starts [0 ]) + m .string [s : m . end () ]
1075
1075
if n > 5 : # more than 5 apostrophes -> hide the prior ones
1076
1076
odd_bold_italics ^= True
1077
1077
odd_italics ^= True
1078
1078
s = starts [- 5 ]
1079
- return b'_' * (s - starts [0 ]) + m .string [s : starts [ - 1 ] + 1 ]
1079
+ return b'_' * (s - starts [0 ]) + m .string [s : m . end () ]
1080
1080
1081
1081
return bytearray (b'\n ' ).join (
1082
1082
[
You can’t perform that action at this time.
0 commit comments