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 @@
  • Jump to search box/
  • -
    1. Can call abstract operations in this spec: Internal();
    2. Can call abstract operations in ES6: ReturnIfAbrupt(completion);
    3. Can call abstract operations in a biblio file: Biblio();
    4. Unfound abstract operations just don't link: Unfound();
    5. Can prefix with ! and ?.
      1. Let foo be ? Internal();
      2. Set foo to ! Internal();
      3. Set foo to ! SDO of operation.
      4. Set foo to ! operation.[[MOP]]().
    +
    1. Can call abstract operations in this spec: Internal();
    2. Can call abstract operations in ES6: ReturnIfAbrupt(completion);
    3. Can call abstract operations in a biblio file: Biblio();
    4. Unfound abstract operations just don't link: Unfound();
    5. Can prefix with ! and ?.
      1. Let foo be ? Internal();
      2. Set foo to ! Internal();
      3. Set foo to ! SDO of operation.
      4. Set foo to ! operation.[[MOP]]().
    6. A Record looks like this: Record { [[Key]]: 0 }.
    7. A List looks like this: « 0, 1 ».

    1 Internal Function

    diff --git a/test/baselines/sources/algorithms.html b/test/baselines/sources/algorithms.html index 9a8c2e7c..0cd79c68 100644 --- a/test/baselines/sources/algorithms.html +++ b/test/baselines/sources/algorithms.html @@ -14,6 +14,8 @@ 1. Set _foo_ to ! Internal(); 1. Set _foo_ to ! SDO of _operation_. 1. Set _foo_ to ! _operation_.[[MOP]](). + 1. A Record looks like this: Record { [[Key]]: 0 }. + 1. A List looks like this: « 0, 1 ».