You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Typography writes U+00A0 into raw <style> blocks — the fr getting_started page loses its CSS #325
The French typography pass puts U+00A0 into CSS inside raw <style> blocks, and the French edition's getting_started page is live with broken figure widths.
What happens
applyTypography treats the lines of a raw HTML <style> block as prose. On English getting_started.md @b0b0b56, dist/typography.js (v0.29.2) changes four declaration lines to width : 70% ;, height : auto ;, width : 80% ;, height : auto ;, each with U+00A0 before : and ;. The French edition carries exactly these bytes (getting_started.md lines 54/55/58/59, from the seed's typography pass) and serves them at https://quantecon.github.io/lecture-python-programming.fr/getting_started.html.
U+00A0 is not CSS whitespace (https://www.w3.org/TR/css-syntax-3/#whitespace) — it is an ident code point — so the property names become unknown idents and the .auto / .terminal declarations are dropped. The page's 11 figures render full-width instead of 70% / 80%.
A hand repair on the edition does not last: file-processor.ts:122 re-copies the English pre-title and :559 re-applies typography on every UPDATE sync of the file.
Proposed change
Treat CommonMark type-1 HTML blocks — <script>, <pre>, <style>, <textarea>, case-insensitive — as literal:
Multi-line: in classifyLines, mark every line from the opener through the first line containing the matching closer as ineligible, with the same stack discipline used for fences, including inside prose directives.
Single-line: mask the whole <(script|pre|style|textarea)\b[^>]*>.*?</\1> span before the generic tag mask (typography.ts:185, /<[^>\n]+>/g, masks only the tags, so <style>.a { width: 1px; }</style> still becomes width : 1px ;).
Tests: the getting_started block; a single-line style; a style block inside a {note}; a <pre> case; idempotence; and a file-processor UPDATE test that a pre-title style block passes through byte-identical.
Then, after the release reaches @v0, a 4-line fr PR removing the U+00A0 from that block (the next sync would otherwise keep it until the English file changes).
Only one source block exists across the 228 lectures surveyed, but the engine reproduces it on every write, so this is a deterministic bug rather than a pattern waiting for a second occurrence.
Found in the 2026-10-05 codebase review: the classifyLines gap behind the <style> damage breaks two more line classes, and one of them is live on the fr edition. Both are in the same function this issue's fix changes, so they are cheapest to fold in before it lands.
GFM table delimiter rows.| :--- | ---: | becomes | :--- | ---<U+00A0>: |, and centre-aligned :---: is damaged the same way. That is no longer a delimiter row, so the table renders as a paragraph of pipes. QuantEcon/lecture-python-programming.fr lectures/pandas.md:169 is the delimiter row of the POP/XRAT/tcgdp indicator table. Its English source row is | :-: | :-: |, but the edition ships | :-<U+00A0>: | :-<U+00A0>: |. https://quantecon.github.io/lecture-python-programming.fr/pandas.html serves that table as a single <p> of literal pipes (checked 2026-10-06). Like the <style> block, it is re-typeset on every UPDATE sync (file-processor.ts:559), so a hand repair would not last.
MyST +++ {json} block breaks.+++ {"user_expressions": []} gains U+00A0 before the :. U+00A0 is not JSON whitespace, so the metadata no longer parses: jupytext rejects the typeset file with MystMetadataParsingError: ... Expecting ':' delimiter. This is dormant for fr, whose sources have only bare +++ lines. lecture-python-intro has 30 such lines in 7 files.
I reproduced both with applyTypography(…, 'fr') from dist/ at 415cf87, at top level and inside a {note}. Compact rows (|:--|--:|, |-----|----:|) and bare +++ are left alone. An already-damaged row also passes through as it is, so nothing repairs it today. markdown-it-py (commonmark + table) renders the original rows as tables and the typeset rows as paragraphs.
Scope addition
In classifyLines, mark two more line classes ineligible at both points (typography.ts:163-165 and :174):
/^\s*\+\+\+/;
delimiter rows: only [\s|:-], containing both | and -. JS \s includes U+00A0/U+202F, so damaged rows match too.
Strip U+00A0/U+202F from those delimiter rows, as DEFINITION_CORRUPTED (:239) does for definitions, so the next sync of pandas.md heals the table. applyTypography (:290) passes ineligible lines through untouched. The repair therefore has to run on the delimiter rows classifyLines now excludes at those two points, and not inside applyToProse. Rows inside code fences stay untouched.
Tests:
spaced right- and centre-aligned rows, with compact rows unchanged;
+++ at top level and inside a {note};
a damaged row repaired;
idempotence;
an UPDATE pass-through.
The one-line fr fix at pandas.md:169 can go in this issue's getting_started edition PR, after the release reaches @v0. If this issue's PR is already in review, a follow-up PR straight after works equally well. The pandas edition fix then waits for that release, because the next sync would otherwise re-damage the row.
Refs: #324 (the other fr typography fix in flight, in the same module), #346 (the release that carries this issue).
Done in both halves. The engine side, the fr typography pass leaving raw <style>/<script>/<pre>/<textarea> blocks, +++ cell breaks and table delimiter rows alone (and repairing a damaged delimiter row), is #474, released in v0.34.0 (https://github.com/QuantEcon/action-translation/releases/tag/v0.34.0). The edition side, after v0 moved: QuantEcon/lecture-python-programming.fr#119, merged 2026-11-26 as 5f41c39, removed the 8 U+00A0 before : and ; in lectures/getting_started.md's <style> block, which is now byte-identical to the English; pandas.md's delimiter row was repaired in lecture-python-programming.fr#118. A scan of all 33 fr lecture files found no other damage of this class (code, CSS, +++, table delimiters, front matter).
Activity
quantecon-services commentedon Oct 6, 2026
Found in the 2026-10-05 codebase review: the
classifyLinesgap behind the<style>damage breaks two more line classes, and one of them is live on the fr edition. Both are in the same function this issue's fix changes, so they are cheapest to fold in before it lands.| :--- | ---: |becomes| :--- | ---<U+00A0>: |, and centre-aligned:---:is damaged the same way. That is no longer a delimiter row, so the table renders as a paragraph of pipes. QuantEcon/lecture-python-programming.frlectures/pandas.md:169is the delimiter row of the POP/XRAT/tcgdp indicator table. Its English source row is| :-: | :-: |, but the edition ships| :-<U+00A0>: | :-<U+00A0>: |. https://quantecon.github.io/lecture-python-programming.fr/pandas.html serves that table as a single<p>of literal pipes (checked 2026-10-06). Like the<style>block, it is re-typeset on every UPDATE sync (file-processor.ts:559), so a hand repair would not last.+++ {json}block breaks.+++ {"user_expressions": []}gains U+00A0 before the:. U+00A0 is not JSON whitespace, so the metadata no longer parses: jupytext rejects the typeset file withMystMetadataParsingError: ... Expecting ':' delimiter. This is dormant for fr, whose sources have only bare+++lines. lecture-python-intro has 30 such lines in 7 files.I reproduced both with
applyTypography(…, 'fr')fromdist/at415cf87, at top level and inside a{note}. Compact rows (|:--|--:|,|-----|----:|) and bare+++are left alone. An already-damaged row also passes through as it is, so nothing repairs it today. markdown-it-py (commonmark+table) renders the original rows as tables and the typeset rows as paragraphs.Scope addition
classifyLines, mark two more line classes ineligible at both points (typography.ts:163-165and:174):/^\s*\+\+\+/;[\s|:-], containing both|and-. JS\sincludes U+00A0/U+202F, so damaged rows match too.DEFINITION_CORRUPTED(:239) does for definitions, so the next sync ofpandas.mdheals the table.applyTypography(:290) passes ineligible lines through untouched. The repair therefore has to run on the delimiter rowsclassifyLinesnow excludes at those two points, and not insideapplyToProse. Rows inside code fences stay untouched.+++at top level and inside a{note};The one-line fr fix at
pandas.md:169can go in this issue'sgetting_startededition PR, after the release reaches@v0. If this issue's PR is already in review, a follow-up PR straight after works equally well. The pandas edition fix then waits for that release, because the next sync would otherwise re-damage the row.Refs: #324 (the other fr typography fix in flight, in the same module), #346 (the release that carries this issue).
Generated by Claude Code
dev: 2026-10-05 codebase review — logs, hardening tracker #349, NEXT-…
dev: log + STATE.md — zh-cn triage, the whole-document head, #280's o…
whole-document: write the source's head; refuse a broken front matter (…
whole-document: write the source's head; refuse a broken front matter (…
typography: leave raw HTML blocks, +++ breaks and table delimiter row…
typography: review fixes — tests for every elision prefix; the heal s…
typography: leave raw HTML blocks, +++ breaks and table delimiter row…
typography: review fixes — tests for every elision prefix; the heal s…
typography: second review round — a raw block in a directive ends at …
Overnight 4/6, French typography: no non-breaking spaces in CSS, tabl…
dev: STATE's Next says what v0.34.0 carries and what follows it
chore: release v0.34.0 (#489)
dev: v0.34.0 released (#490)
getting_started: remove the non-breaking spaces from the <style> block (
mmcky commentedon Nov 26, 2026
Done in both halves. The engine side, the
frtypography pass leaving raw<style>/<script>/<pre>/<textarea>blocks,+++cell breaks and table delimiter rows alone (and repairing a damaged delimiter row), is #474, released in v0.34.0 (https://github.com/QuantEcon/action-translation/releases/tag/v0.34.0). The edition side, afterv0moved: QuantEcon/lecture-python-programming.fr#119, merged 2026-11-26 as5f41c39, removed the 8 U+00A0 before:and;inlectures/getting_started.md's<style>block, which is now byte-identical to the English;pandas.md's delimiter row was repaired in lecture-python-programming.fr#118. A scan of all 33 fr lecture files found no other damage of this class (code, CSS,+++, table delimiters, front matter).