Skip to content

Commit 9d5b0cc

Browse files
committed
Fix dollar escapes at beginning of line
If the escaped dollar is at the beginning of the line, it does not get replaced with the previous code, because it requires a preceding space.
1 parent d211233 commit 9d5b0cc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/generate_textbook.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ def _clean_lines(lines, filepath):
8484
for char in inline_replace_chars:
8585
line = line.replace('\\{}'.format(char), '\\\\{}'.format(char))
8686
line = line.replace(' \\$', ' \\\\$')
87+
# Escaped dollar could be at beginning of line
88+
if line.startswith('\\$'):
89+
line = '\\' + line
8790
lines[ii] = line
8891
return lines
8992

0 commit comments

Comments
 (0)