gstack/make-pdf
rssprivacy-commits 40a9fdd2f1 fix(make-pdf): correct CJK rendering — URL sentinel leak, JP-first fonts, CJK quotes
Three defects surfaced rendering Simplified-Chinese documents; refined after
an independent two-model code audit (which caught a regression in the first
pass of the quote fix).

1. Bare URLs leaked internal `SMARTPANTS_PRESERVED_N` sentinels into output
   AND left <a>/<p> unclosed (everything after became one hyperlink).
   URL_RE's `\S+` (NUL is non-whitespace) swallowed the adjacent tag
   placeholders; single-pass restore could not un-nest them.
   Fix: stop the URL match at the NUL boundary; additionally strip any
   stray NUL from input at smartypants() entry so text cannot forge a
   placeholder or create NUL-adjacency nesting.

2. The CJK font stack listed Hiragino (Japanese) before any Chinese font,
   so Simplified-Chinese text rendered in Japanese glyph variants
   (直/骨/角/没). Fix: PingFang SC / Noto Sans CJK SC / Source Han Sans SC
   / Microsoft YaHei first; JP fonts demoted to last resort. (Trade-off:
   true Japanese documents now prefer SC glyphs for shared Han; acceptable
   for an SC-primary tool. A lang-attribute-based selector would be the
   fuller fix.)

3. A quote directly after a CJK colon or opening bracket (:(【「『〈《)
   is now treated as opening. Sentence/clause-ending punctuation
   (,。、;!?) is deliberately excluded — a quote after those is usually
   a CLOSING quote (Chinese puts the period inside: 。"), and including
   them flipped closing quotes to opening.

Verified: pdffonts PingFang-only; pdftotext no sentinel leak, correct
opening AND closing quotes (他说:"你好。" closes correctly); visual render
no anchor bleed. make-pdf/test: 91 pass / 0 fail.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 12:19:43 +08:00
..
src fix(make-pdf): correct CJK rendering — URL sentinel leak, JP-first fonts, CJK quotes 2026-06-15 12:19:43 +08:00
test v1.52.2.0 fix(make-pdf): render emoji instead of tofu (▯) on Linux (#1787) 2026-05-29 18:06:19 -07:00
SKILL.md v1.57.4.0 refactor(ethos): rename Boil the Lake principle to Boil the Ocean (#1912) 2026-06-08 05:41:07 -07:00
SKILL.md.tmpl v1.52.2.0 fix(make-pdf): render emoji instead of tofu (▯) on Linux (#1787) 2026-05-29 18:06:19 -07:00