diff --git a/src/Algorithm.ts b/src/Algorithm.ts index 8cc0b572..71580cbb 100644 --- a/src/Algorithm.ts +++ b/src/Algorithm.ts @@ -135,7 +135,9 @@ export default class Algorithm extends Builder { const rawHtml = emd.emit(emdTree); // replace spaces after !/? with to prevent bad line breaking - const html = rawHtml.replace(/((?:\s+|>)[!?])[ \t]+/g, '$1 '); + let html = rawHtml.replace(/((?:\s+|>)[!?])[ \t]+/g, '$1 '); + // replace spaces before »/} with to prevent bad line breaking + html = html.replace(/[ \t]+([»}])/g, ' $1'); node.innerHTML = html; const labeledStepEntries: StepBiblioEntry[] = []; diff --git a/test/baselines/generated-reference/algorithms.html b/test/baselines/generated-reference/algorithms.html index 19e47c1b..d7c41034 100644 --- a/test/baselines/generated-reference/algorithms.html +++ b/test/baselines/generated-reference/algorithms.html @@ -7,7 +7,7 @@
/