markstream-vue 1.0.0 → 1.0.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -318,6 +318,14 @@ const nodes = parseMarkdownToStructure('# Hello\n\nThis is parsed once', md)
318
318
  // send `nodes` JSON to the client
319
319
  ```
320
320
 
321
+ > Warning: `parseMarkdownToStructure` defaults to `streamParse: 'auto'`: compatible `md` instances use `md.stream.parse` for non-final top-level parses and retain the latest source/token cache. Final one-shot parses use the regular parser unless you pass `{ streamParse: true }`; pass `{ streamParse: false }` to opt out. If you reuse one `md` instance for unrelated one-shot documents, pass `{ final: true }` or `{ streamParse: false }`.
322
+
323
+ ```ts
324
+ const nodes = parseMarkdownToStructure(source, md, { final: true })
325
+ ```
326
+
327
+ When `MarkdownRender` parses its own `content`, it intentionally defaults `parseOptions.streamParse` to `true` so streaming parses use `md.stream.parse`. When `final` changes, the renderer invalidates the stream cache and reparses with final semantics to avoid stale loading or unclosed-token state. Pass `:parse-options="{ streamParse: 'auto' }"` to keep final content parses on the regular parser, or `false` to opt out entirely.
328
+
321
329
  ```vue
322
330
  <!-- client -->
323
331
  <MarkdownRender :nodes="nodesFromServer" />
package/README.zh-CN.md CHANGED
@@ -310,6 +310,8 @@ const nodes = parseMarkdownToStructure('# Hello\n\n服务端解析一次', md)
310
310
  // 将 nodes JSON 下发到客户端
311
311
  ```
312
312
 
313
+ > 注意:`parseMarkdownToStructure` 默认是 `streamParse: 'auto'`:兼容的 `md` 实例会在非 final 顶层解析时使用 `md.stream.parse`,并保留最近一次 source/token cache。final 一次性解析默认走普通 parser;需要强制 stream 时传 `{ streamParse: true }`,需要关闭时传 `{ streamParse: false }`。如果复用同一个 `md` 解析互不相关的一次性文档,请传 `{ final: true }` 或 `{ streamParse: false }`。
314
+
313
315
  ```vue
314
316
  <!-- client -->
315
317
  <MarkdownRender :nodes="nodesFromServer" />