Repository navigation
chore(parser): upgrade markdown-it-ts to 1.1.8 - #840
Merged
Merged
Conversation
markdown-it-ts 1.1.8 fixes the streaming tail segment, which reparsed the first line of the last top-level block. A plugin rule that emits two blocks from one line (display math followed by trailing text) therefore re-emitted the math block on top of the cached copy, so `Intro\n\n$$E=mc^2$$, where E is energy.\n\nEnd` streamed one character at a time produced up to 23 `math_block` nodes for the single formula. Bump the bundled dependency and add a regression test that streams the document one character at a time (plus a chunked pass) and compares the streamed nodes with a cold parse. Against markdown-it-ts 1.1.7 all three cases fail; with 1.1.8 they pass.
Deploying markstream-vue with
|
| Latest commit: |
a06403e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9d57e5af.markstream-vue.pages.dev |
| Branch Preview URL: | https://chore-upgrade-markdown-it-ts-yky5.markstream-vue.pages.dev |
Deploying markstream-vue-docs with
|
| Latest commit: |
a06403e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f9263a6c.markstream-vue-docs.pages.dev |
| Branch Preview URL: | https://chore-upgrade-markdown-it-ts-4ytk.markstream-vue-docs.pages.dev |
Deploying markstream-nuxt with
|
| Latest commit: |
a06403e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bef3cfa9.markstream-nuxt.pages.dev |
| Branch Preview URL: | https://chore-upgrade-markdown-it-ts-3o7o.markstream-nuxt.pages.dev |
Deploying markstream-vue2 with
|
| Latest commit: |
a06403e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://57e0c2f0.markstream-vue2.pages.dev |
| Branch Preview URL: | https://chore-upgrade-markdown-it-ts-g7kf.markstream-vue2.pages.dev |
Deploying markstream-react with
|
| Latest commit: |
a06403e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://285c4753.markstream-react.pages.dev |
| Branch Preview URL: | https://chore-upgrade-markdown-it-ts-ywsy.markstream-react.pages.dev |
Deploying markstream-angular with
|
| Latest commit: |
a06403e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://920852c7.markstream-angular.pages.dev |
| Branch Preview URL: | https://chore-upgrade-markdown-it-ts-19dl.markstream-angular.pages.dev |
Deploying markstream-svelte with
|
| Latest commit: |
a06403e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b61e57c8.markstream-svelte.pages.dev |
| Branch Preview URL: | https://chore-upgrade-markdown-it-ts-944e.markstream-svelte.pages.dev |
Deploying markstream-solid with
|
| Latest commit: |
a06403e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://2f5b6f5b.markstream-solid.pages.dev |
| Branch Preview URL: | https://chore-upgrade-markdown-it-ts.markstream-solid.pages.dev |
Deploying markstream-octane with
|
| Latest commit: |
a06403e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://25c3037b.markstream-octane.pages.dev |
| Branch Preview URL: | https://chore-upgrade-markdown-it-ts.markstream-octane.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What broke
stream-markdown-parserbundlesmarkdown-it-tsinto its dist, so the streaming fix has to be picked up here, not by consumers upgradingmarkdown-it-tsdirectly.markdown-it-ts<= 1.1.7 reparsed the tail of the last top-level block starting from that block's first line. A block rule that emits two top-level blocks from one line — display math followed by the trailing text, as the math rule does for$$x$$ text— therefore re-emitted the math block next to the cached copy. Streamingone character at a time through
parseMarkdownToStructure(prefix, md, { final: false })produced up to 23math_blocknodes for the single formula.Change
packages/markdown-parser/package.json:markdown-it-ts^1.1.7→^1.1.8, with the matchingpnpm-lock.yamlentries (importer, package resolution, snapshot).pnpm install --frozen-lockfile --lockfile-onlyconfirms the lock is consistent.packages/markdown-parser/test/same-line-math-streaming.test.ts:math_blockat every prefix of the document,math_block.Verification
prefix "Intro\n\n$$E=mc^2$$, "→ 2 math blocks, streamed ≠ cold).pnpm --filter stream-markdown-parser typecheckand ESLint clean;pnpm --filter stream-markdown-parser buildinlines 1.1.8 intodist.After merge
stream-markdown-parserneeds a release (the dist embeds the parser), thenmarkstream-vuecan move to it.