+25
−1
Loading
The CSS `content: "${BL} — Motion Control"` line was rendering literally
because the raw Python string doesn't do substitution and CSS has no
variable syntax of its own. Extract the BL token from the document's
`**Instrument:**` metadata line (handling both 'BL4B' and
'BL4B (Liquids Reflectometer)' forms) and do a plain string replace on
the CSS before passing it to WeasyPrint — simplest thing that works
given the CSS body is full of '{', '}', and '$' characters that would
trip up str.format / string.Template.
Co-Authored-By:
Claude Opus 4.6 (1M context) <noreply@anthropic.com>