Skip to content

Commit d43ab05

Browse files
authored
Preserve multiple mid-line space in autogen /$ (#1718)
In GG1, `/$` markup not only indents using an HTML span with margin, but also replaces pairs of mid-line spaces with `  `. Without that, HTML compresses the multiple spaces to one, which is not what is wanted. This makes GG2 do the same. Fixes #1717
1 parent 54e1167 commit d43ab05

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/guiguts/html_convert.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,10 @@ def maybe_close_chapter_div(chapter_div_open: bool, next_step: int) -> int:
667667
# lines within "/$" or "/*" markup
668668
if dollar_nowrap_flag or asterisk_nowrap_flag:
669669
do_per_line_markup(selection, line_start, line_end, ibs_dict)
670+
# Preserve mid-line multiple spaces for "/$"
671+
if dollar_nowrap_flag:
672+
nbsp_sel = re.sub(" ", "  ", selection.lstrip())
673+
maintext().replace(line_start, line_end, nbsp_sel)
670674
# Add 0.5em margin per space character
671675
if n_spaces > 0:
672676
maintext().insert(

0 commit comments

Comments
 (0)