Draft: add safe class-based syntax highlighting - #38
Conversation
Add regression coverage that exercises SVG set and animate URL filtering and fails against the vulnerable dependency release. Agent-Signature: codex-gpt-5.2-high on behalf of Matt Wilkie
Agent-Signature: codex-unknown-model- on behalf of Matt Wilkie
Checkpoint is blocked on syntect's transitive RUSTSEC-2025-0141 audit warning. Agent-Signature: codex-unknown-model- on behalf of Matt Wilkie
|
Blocker research update: syntect's codex-gpt-5.2-high on behalf of Matt Wilkie |
Address PR #37 review findings: - Strip YAML front matter before parsing instead of enabling ENABLE_YAML_STYLE_METADATA_BLOCKS: pulldown-cmark 0.13 recognizes metadata blocks anywhere at indent 0, silently swallowing mid-document text framed by `---` lines. The hand-rolled yaml_front_matter splitter is now the single source of truth for both hiding the block and title derivation. - Make the splitter conservative and GitHub-like: front matter only at the very start of the document, closing `---`/`...` on its own line (trailing spaces ok, tabs not), block non-empty with a non-blank first line, so `---\n\ntitle: fake\n---` can no longer spoof the page title. - Keep GFM alerts styled with JavaScript disabled: add plain :root light-palette defaults and a prefers-color-scheme dark media query alongside the existing data-theme theme-toggle overrides. - Add regression tests for mid-document `---` blocks and blank-first-line pseudo front matter; extend the alert CSS test. - cfg-gate unix-only Duration/Instant test imports so `cargo clippy --all-targets -- -D warnings` also passes on Windows. - Record GFM alerts and YAML front matter in the changelog. Agent-Signature: claude-code-fable-5 on behalf of maphew Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GvsZX2KKgN6BrCCrNrJ5BW
Address review findings on the class-based syntax highlighting draft: - Infinite-loop DoS: distinguish destroyed placeholders (count 0, e.g. swallowed as rawtext by a user-authored unclosed <style>/<script>) from collisions (count >1). Destroyed fences fall back to plain code blocks instead of retrying forever, and collision retries are capped at 16 before highlighting is disabled entirely. Both render paths now share one spliced_markdown_body loop with a termination guarantee. - Theme CSS scoping: scope every comma-separated selector in generated theme rules, not just the first, so dark palette colors can no longer leak into light mode; test now asserts every selector is scoped. - Size cap: fenced blocks over 200 KB skip syntect (fancy-regex worst cases are superlinear) and render as plain escaped code. - Language aliases: map common fence tokens (sh/shell/zsh, yml, csharp/cs, c++, jsonc, ts/tsx/typescript) to bundled syntaxes; the bundled set has no TypeScript grammar so those map to JavaScript. - cargo-audit: ignore RUSTSEC-2025-0141 (bincode 1.x unmaintained, transitive via syntect dump-load; no feature-flag remedy) via .cargo/audit.toml, verified locally with cargo audit --deny warnings. - Document why the global class/id attribute allowance is safe. - Gate Duration/Instant imports in tests/cli.rs behind cfg(unix) so clippy -D warnings also passes on Windows hosts. Agent-Signature: claude-code-fable-5 on behalf of maphew Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GvsZX2KKgN6BrCCrNrJ5BW
|
Pushed baf5d12 addressing the review punch list: 1. Infinite-loop DoS (high). The render/sanitize retry loops in 2. Theme CSS scoping (medium). 3. Size cap (medium). Fenced blocks larger than 4. Audit exemption. CI fails on RUSTSEC-2025-0141: bincode 1.3.3 is unmaintained and pulled in transitively via syntect's dump-load feature; syntect offers no feature-flag remedy today. Added 5. Language aliases (low). Added an alias map consulted before 6. Documented at the Also gated the Quality gates: claude-code-fable-5 on behalf of maphew |
Preserve conservative front-matter stripping and no-JS alert palettes while integrating the stacked base branch. Agent-Signature: codex-gpt-5.6-sol-high on behalf of matt wilkie
Resolve the changelog release-boundary conflict by keeping the new alert and front-matter entries under Unreleased while preserving the 0.6.1 notes from main. Agent-Signature: codex-gpt-5.6-sol-medium on behalf of maphew
Integrate the current #37 head, including its merge from main, so this branch is compatible with the retargeted stack. Agent-Signature: codex-gpt-5.6-sol-high on behalf of matt wilkie
Splice generated highlighting into raw renderer output before sanitization so normalized placeholder spoofs cannot redirect post-sanitize markup. Add no-JS light and OS-dark palettes with explicit manual theme overrides. Agent-Signature: codex-gpt-5.6-sol-high on behalf of matt wilkie
Resolve the squash-merge overlap by retaining the already-integrated front-matter and alert fixes alongside the syntax-highlighting implementation. Agent-Signature: codex-gpt-5.6-sol-medium on behalf of maphew
Integrate the merged orb-sizing PR before publishing the syntax-highlighting draft. Agent-Signature: codex-gpt-5.6-sol-medium on behalf of maphew
Do not claim a Beads tracking issue exists before the maintenance-risk exemption has been accepted and tracked. Agent-Signature: codex-gpt-5.6-sol-medium on behalf of maphew
|
PR sweep update: pushed repaired, current- Addressed code blockers:
Independent review found no remaining functional or security blocker. Local validation passed: formatting, clippy with warnings denied, 90 Rust tests, Human decision required before ready/merge: accept or reject the narrow codex-gpt-5.6-sol-medium on behalf of maphew |
Checkpoint summary