Skip to content

fix: unify default engine with createProcessor for consistent blockquote rendering#444

Merged
jaredwray merged 2 commits intomainfrom
claude/review-writr-issue-443-CNG1Y
Mar 30, 2026
Merged

fix: unify default engine with createProcessor for consistent blockquote rendering#444
jaredwray merged 2 commits intomainfrom
claude/review-writr-issue-443-CNG1Y

Conversation

@jaredwray
Copy link
Copy Markdown
Owner

Summary

  • Unifies the default engine with createProcessor — the static default engine (line 51) was hand-coded and inconsistent with createProcessor, missing remarkGithubBlockquoteAlert and having remarkMath in the wrong plugin phase (after remarkRehype instead of before). The constructor now always uses createProcessor to build the engine.
  • Fixes remarkMath plugin orderingremarkMath is a remark plugin (mdast phase) but was placed after remarkRehype (the bridge to hast). It's now correctly placed before remarkRehype, with rehypeKatex remaining in the rehype phase.
  • Adds test coverage for blockquote + list rendering — three new tests covering the exact scenario from issue Content inside blockquotes don't follow markdown rules. #443 (lists inside blockquotes with emoji), lists without blank separator lines, and sync rendering.

Closes #443

Test plan

  • All 176 existing tests pass
  • 3 new blockquote + list tests pass
  • pnpm build succeeds
  • pnpm test passes with 100% statement/function/line coverage

https://claude.ai/code/session_01EtCwTREZoVsyLxnPKp6Fzu

…gin order

The default engine was hand-coded and inconsistent with createProcessor:
- Missing remarkGithubBlockquoteAlert plugin
- remarkMath placed after remarkRehype (wrong phase)
- remarkToc had different heading config

Now the constructor always uses createProcessor to build the engine,
ensuring consistent markdown rendering including lists inside blockquotes.

Also moves remarkMath before remarkRehype where it belongs as a remark
plugin (mdast phase), and splits rehypeKatex to remain in the rehype phase.

Adds tests for blockquote + list rendering (issue #443).

https://claude.ai/code/session_01EtCwTREZoVsyLxnPKp6Fzu
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a2b0867) to head (1c02d50).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #444   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          470       472    +2     
  Branches       105       109    +4     
=========================================
+ Hits           470       472    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the Writr class to centralize the initialization of the unified processor and improves the handling of Markdown plugins like remarkToc and remarkMath. Specifically, the engine property is now initialized once in the constructor using a dedicated createProcessor method, and new tests have been added to ensure correct rendering of lists within blockquotes. A review comment suggests improving type safety by replacing the any type on the engine property with a more specific type from the unified package.

Addresses review feedback to improve type safety on the public engine
property and createProcessor return type.

https://claude.ai/code/session_01EtCwTREZoVsyLxnPKp6Fzu
@jaredwray jaredwray merged commit 9017afa into main Mar 30, 2026
11 checks passed
@jaredwray jaredwray deleted the claude/review-writr-issue-443-CNG1Y branch March 30, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Content inside blockquotes don't follow markdown rules.

2 participants