We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d2edc90 commit d583b1fCopy full SHA for d583b1f
.changeset/many-pandas-agree.md
@@ -0,0 +1,5 @@
1
+---
2
+"streamdown": patch
3
4
+
5
+import `Lexer` only for possible tree-shaking
packages/streamdown/lib/parse-blocks.tsx
@@ -1,7 +1,7 @@
-import { marked } from "marked";
+import { Lexer } from "marked";
export const parseMarkdownIntoBlocks = (markdown: string): string[] => {
- const tokens = marked.use({ gfm: true }).lexer(markdown);
+ const tokens = Lexer.lex(markdown, { gfm: true });
const blocks = tokens.map((token) => token.raw);
6
7
// Post-process to merge consecutive blocks that are part of the same math block
0 commit comments