@coderminer/vue-markdown 0.0.0-stage → 1.0.1
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/CHANGELOG.md +226 -0
- package/LICENSE +21 -0
- package/README.md +584 -3
- package/README.zh-CN.md +550 -0
- package/dist/chunks/MarkdownBlockquote-DVXziX2t.js +16 -0
- package/dist/chunks/MarkdownBreak-BwCi2Itt.js +16 -0
- package/dist/chunks/MarkdownCode-B1k9tmW5.js +63 -0
- package/dist/chunks/MarkdownConfigProvider-5N3ylrIu.js +49 -0
- package/dist/chunks/MarkdownContent-BAK6dqo7.js +13 -0
- package/dist/chunks/MarkdownCustomTag-lZJHsD6f.js +46 -0
- package/dist/chunks/MarkdownEmphasis-CppivOEu.js +16 -0
- package/dist/chunks/MarkdownEmpty-Av5k6bqa.js +14 -0
- package/dist/chunks/MarkdownError-C0sPs5W0.js +17 -0
- package/dist/chunks/MarkdownFootnoteReference-Dy3Khwyj.js +22 -0
- package/dist/chunks/MarkdownFootnotes-BRPzkbXv.js +21 -0
- package/dist/chunks/MarkdownHeading-DaNcP0_6.js +29 -0
- package/dist/chunks/MarkdownHorizontalRule-QNe_cuUI.js +16 -0
- package/dist/chunks/MarkdownHtml-66lYkvwM.js +13 -0
- package/dist/chunks/MarkdownImage-BRy76svs.js +51 -0
- package/dist/chunks/MarkdownInlineCode-MXZYFwex.js +16 -0
- package/dist/chunks/MarkdownLink-Dbx3NwgV.js +45 -0
- package/dist/chunks/MarkdownList-BJ-_C71k.js +20 -0
- package/dist/chunks/MarkdownListItem-Z1EHIY26.js +16 -0
- package/dist/chunks/MarkdownLoading-D-RYtXxf.js +15 -0
- package/dist/chunks/MarkdownParagraph-BxLSmSaG.js +16 -0
- package/dist/chunks/MarkdownRenderer-OlkdsvI3.js +482 -0
- package/dist/chunks/MarkdownRoot-DEE6iVfh.js +23 -0
- package/dist/chunks/MarkdownStrikethrough-CblvbqDk.js +16 -0
- package/dist/chunks/MarkdownStrong-uU5MzAoJ.js +16 -0
- package/dist/chunks/MarkdownTable-DmBTg_CR.js +16 -0
- package/dist/chunks/MarkdownTableCell-eiCJe847.js +31 -0
- package/dist/chunks/MarkdownTableRow-DuJaPntg.js +16 -0
- package/dist/chunks/MarkdownTableSection-PFHz-R33.js +24 -0
- package/dist/chunks/MarkdownTaskItem-BcmKo1lk.js +38 -0
- package/dist/chunks/MarkdownToc-DHWWoH6t.js +49 -0
- package/dist/chunks/MarkdownTocItem-DT9mR3vL.js +25 -0
- package/dist/chunks/MermaidLiveEditor-1TKkI5bp.js +414 -0
- package/dist/chunks/VueSyntaxHighlighter-BWpCO-cX.js +260 -0
- package/dist/chunks/adapters-CMwX_NEI.js +26 -0
- package/dist/chunks/asyncToGenerator-ChigusFD.js +26 -0
- package/dist/chunks/blank-line-CKKsFeKR.js +88 -0
- package/dist/chunks/codemirror-DyphMAEg.js +82 -0
- package/dist/chunks/config-aRYo2R8_.js +10 -0
- package/dist/chunks/context-8NfW6fxI.js +30 -0
- package/dist/chunks/convert-hast-C4Rg2ZuF.js +6 -0
- package/dist/chunks/default-ZQ5aHh-N.js +3 -0
- package/dist/chunks/diagnostics-CtHoJyiX.js +23 -0
- package/dist/chunks/export-BrgMLgUp.js +1574 -0
- package/dist/chunks/hast-to-nodes-DuZsi4XT.js +29 -0
- package/dist/chunks/hast-util-from-html-D3e_iQ89.js +5088 -0
- package/dist/chunks/highlightjs-BxJFpKS1.js +196 -0
- package/dist/chunks/identity-Bi27FKyx.js +6243 -0
- package/dist/chunks/labels-BtHiUTQI.js +47 -0
- package/dist/chunks/lib-CCnkLL6S.js +252 -0
- package/dist/chunks/longest-streak-DZE_EqsU.js +8 -0
- package/dist/chunks/micromark-factory-space-CpXAnYUY.js +137 -0
- package/dist/chunks/normalize-VKfQXZiK.js +226 -0
- package/dist/chunks/objectSpread2-CtBNx0TF.js +57 -0
- package/dist/chunks/plugin-YWo5uqTh.js +27 -0
- package/dist/chunks/preset-BjaOuJUL.js +44 -0
- package/dist/chunks/registry-B7BfEkuy.js +6150 -0
- package/dist/chunks/render-DAqK0w5J.js +1754 -0
- package/dist/chunks/rolldown-runtime-QGRDbDUS.js +19 -0
- package/dist/chunks/runtime-D95F41zG.js +574 -0
- package/dist/chunks/security-y4EwUyAs.js +212 -0
- package/dist/chunks/shared-NjFDPmkb.js +67 -0
- package/dist/chunks/space-separated-tokens-1ebNqf35.js +1097 -0
- package/dist/chunks/url-D2BoivaE.js +24 -0
- package/dist/chunks/useActiveHeading-CnyGTG1u.js +359 -0
- package/dist/components/CodeBlock.d.ts +73 -0
- package/dist/components/CodeBlock.js +1 -0
- package/dist/components/Icon.d.ts +6 -0
- package/dist/components/MarkdownBlockquote.d.ts +18 -0
- package/dist/components/MarkdownBlockquote.js +1 -0
- package/dist/components/MarkdownBreak.d.ts +8 -0
- package/dist/components/MarkdownBreak.js +1 -0
- package/dist/components/MarkdownChildren.d.ts +17 -0
- package/dist/components/MarkdownCode.d.ts +29 -0
- package/dist/components/MarkdownCode.js +1 -0
- package/dist/components/MarkdownConfigProvider.d.ts +33 -0
- package/dist/components/MarkdownConfigProvider.js +1 -0
- package/dist/components/MarkdownContent.d.ts +16 -0
- package/dist/components/MarkdownContent.js +1 -0
- package/dist/components/MarkdownCustomTag.d.ts +20 -0
- package/dist/components/MarkdownCustomTag.js +1 -0
- package/dist/components/MarkdownEmphasis.d.ts +18 -0
- package/dist/components/MarkdownEmphasis.js +1 -0
- package/dist/components/MarkdownEmpty.d.ts +8 -0
- package/dist/components/MarkdownEmpty.js +1 -0
- package/dist/components/MarkdownError.d.ts +11 -0
- package/dist/components/MarkdownError.js +1 -0
- package/dist/components/MarkdownFootnoteReference.d.ts +19 -0
- package/dist/components/MarkdownFootnoteReference.js +1 -0
- package/dist/components/MarkdownFootnotes.d.ts +17 -0
- package/dist/components/MarkdownFootnotes.js +1 -0
- package/dist/components/MarkdownHeading.d.ts +18 -0
- package/dist/components/MarkdownHeading.js +1 -0
- package/dist/components/MarkdownHorizontalRule.d.ts +8 -0
- package/dist/components/MarkdownHorizontalRule.js +1 -0
- package/dist/components/MarkdownHtml.d.ts +8 -0
- package/dist/components/MarkdownHtml.js +1 -0
- package/dist/components/MarkdownImage.d.ts +15 -0
- package/dist/components/MarkdownImage.js +1 -0
- package/dist/components/MarkdownInlineCode.d.ts +18 -0
- package/dist/components/MarkdownInlineCode.js +1 -0
- package/dist/components/MarkdownLink.d.ts +22 -0
- package/dist/components/MarkdownLink.js +1 -0
- package/dist/components/MarkdownList.d.ts +18 -0
- package/dist/components/MarkdownList.js +1 -0
- package/dist/components/MarkdownListItem.d.ts +18 -0
- package/dist/components/MarkdownListItem.js +1 -0
- package/dist/components/MarkdownLoading.d.ts +8 -0
- package/dist/components/MarkdownLoading.js +1 -0
- package/dist/components/MarkdownMath.d.ts +12 -0
- package/dist/components/MarkdownMath.js +1 -0
- package/dist/components/MarkdownMermaid.d.ts +78 -0
- package/dist/components/MarkdownMermaid.js +1 -0
- package/dist/components/MarkdownParagraph.d.ts +18 -0
- package/dist/components/MarkdownParagraph.js +1 -0
- package/dist/components/MarkdownRenderer.d.ts +167 -0
- package/dist/components/MarkdownRenderer.js +1 -0
- package/dist/components/MarkdownRoot.d.ts +24 -0
- package/dist/components/MarkdownRoot.js +1 -0
- package/dist/components/MarkdownStrikethrough.d.ts +18 -0
- package/dist/components/MarkdownStrikethrough.js +1 -0
- package/dist/components/MarkdownStrong.d.ts +18 -0
- package/dist/components/MarkdownStrong.js +1 -0
- package/dist/components/MarkdownTable.d.ts +18 -0
- package/dist/components/MarkdownTable.js +1 -0
- package/dist/components/MarkdownTableCell.d.ts +20 -0
- package/dist/components/MarkdownTableCell.js +1 -0
- package/dist/components/MarkdownTableRow.d.ts +18 -0
- package/dist/components/MarkdownTableRow.js +1 -0
- package/dist/components/MarkdownTableSection.d.ts +18 -0
- package/dist/components/MarkdownTableSection.js +1 -0
- package/dist/components/MarkdownTaskItem.d.ts +20 -0
- package/dist/components/MarkdownTaskItem.js +1 -0
- package/dist/components/MarkdownToc.d.ts +36 -0
- package/dist/components/MarkdownToc.js +1 -0
- package/dist/components/MarkdownTocItem.d.ts +14 -0
- package/dist/components/MarkdownTocItem.js +1 -0
- package/dist/components/MermaidBlock.d.ts +50 -0
- package/dist/components/MermaidBlock.js +1 -0
- package/dist/components/MermaidLiveEditor.d.ts +44 -0
- package/dist/components/MermaidLiveEditor.js +1 -0
- package/dist/components/VueSyntaxHighlighter.d.ts +39 -0
- package/dist/components/VueSyntaxHighlighter.js +1 -0
- package/dist/components/codeRegion.d.ts +14 -0
- package/dist/components/config.d.ts +7 -0
- package/dist/components/context.d.ts +45 -0
- package/dist/components/index.d.ts +42 -0
- package/dist/components/index.js +38 -0
- package/dist/components/render.d.ts +9 -0
- package/dist/components/scroll-lock.d.ts +7 -0
- package/dist/components/types.d.ts +61 -0
- package/dist/composables/useActiveHeading.d.ts +12 -0
- package/dist/composables/useCodeHighlighter.d.ts +30 -0
- package/dist/composables/useLineWindow.d.ts +38 -0
- package/dist/composables/useMarkdownDocument.d.ts +25 -0
- package/dist/core/adapters.d.ts +7 -0
- package/dist/core/config.d.ts +5 -0
- package/dist/core/diagnostics.d.ts +9 -0
- package/dist/core/finalize.d.ts +18 -0
- package/dist/core/hast-nodes.d.ts +3 -0
- package/dist/core/hast-to-nodes.d.ts +9 -0
- package/dist/core/highlight-lines.d.ts +8 -0
- package/dist/core/identity.d.ts +4 -0
- package/dist/core/labels.d.ts +4 -0
- package/dist/core/manifest.d.ts +38 -0
- package/dist/core/memo.d.ts +5 -0
- package/dist/core/model-hast.d.ts +8 -0
- package/dist/core/model.d.ts +10 -0
- package/dist/core/normalize.d.ts +37 -0
- package/dist/core/parts.d.ts +136 -0
- package/dist/core/preset.d.ts +10 -0
- package/dist/core/run.d.ts +16 -0
- package/dist/core/search.d.ts +5 -0
- package/dist/core/security.d.ts +21 -0
- package/dist/core/slugger.d.ts +13 -0
- package/dist/core/types.d.ts +392 -0
- package/dist/core/url.d.ts +10 -0
- package/dist/editor/codemirror.d.ts +14 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/editor/index.js +1 -0
- package/dist/export/index.d.ts +6 -0
- package/dist/headless.d.ts +21 -0
- package/dist/headless.js +12 -0
- package/dist/highlight/convert-hast.d.ts +8 -0
- package/dist/highlight/highlightjs.d.ts +7 -0
- package/dist/highlight/index.d.ts +4 -0
- package/dist/highlight/index.js +4 -0
- package/dist/highlight/shared.d.ts +11 -0
- package/dist/highlight/shiki.d.ts +7 -0
- package/dist/highlight/shiki.js +75 -0
- package/dist/html/index.d.ts +17 -0
- package/dist/html/index.js +11 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +53 -0
- package/dist/math/index.d.ts +4 -0
- package/dist/math/index.js +585 -0
- package/dist/math/katex.d.ts +4 -0
- package/dist/math/plugin.d.ts +20 -0
- package/dist/mermaid/index.d.ts +6 -0
- package/dist/mermaid/index.js +8 -0
- package/dist/mermaid/plugin.d.ts +17 -0
- package/dist/mermaid/runtime.d.ts +14 -0
- package/dist/mermaid/sanitize-svg-lazy.d.ts +10 -0
- package/dist/mermaid/sanitize-svg.d.ts +3 -0
- package/dist/mermaid/sanitize.d.ts +16 -0
- package/dist/node-components.d.ts +1 -0
- package/dist/node-components.js +39 -0
- package/dist/pipeline/custom.d.ts +8 -0
- package/dist/pipeline/identity.d.ts +12 -0
- package/dist/pipeline/index.d.ts +5 -0
- package/dist/pipeline/official.d.ts +6 -0
- package/dist/pipeline.d.ts +1 -0
- package/dist/pipeline.js +1 -0
- package/dist/plugins/builtin.d.ts +15 -0
- package/dist/plugins/define.d.ts +7 -0
- package/dist/plugins/registry.d.ts +16 -0
- package/dist/plugins/source.d.ts +7 -0
- package/dist/plugins.d.ts +3 -0
- package/dist/plugins.js +1 -0
- package/dist/presets.d.ts +3 -0
- package/dist/presets.js +1 -0
- package/dist/style.css +2 -0
- package/dist/styles/components.css +737 -0
- package/dist/styles/index.d.ts +1 -0
- package/dist/styles/math-full.css +3 -0
- package/dist/styles/math.css +18 -0
- package/dist/styles/tokens.css +96 -0
- package/package.json +214 -6
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@coderminer/vue-markdown` are documented here.
|
|
4
|
+
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- The Vue peer range is now `>=3.3.0 <4.0.0`. CI runs the full suite against
|
|
10
|
+
Vue 3.3 and 3.4 in addition to the latest 3.x release.
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- String tag overrides (`components: { h1: 'h2' }`), unknown-tag fallbacks, and
|
|
15
|
+
raw HTML element nodes render their children on Vue 3.3 and 3.4. The renderer
|
|
16
|
+
passed a slot function to an element vnode, which only Vue 3.5 resolves.
|
|
17
|
+
|
|
18
|
+
## [1.0.1] - 2026-11-02
|
|
19
|
+
|
|
20
|
+
Patch release that closes runtime and contract issues found after 1.0.0. The
|
|
21
|
+
package has no external users yet, so it includes intentional contract
|
|
22
|
+
tightenings: the `externalLinkTarget` type is narrowed and `mermaidPlugin()`
|
|
23
|
+
rejects non-object arguments.
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- The `MarkdownRenderer` `searchDebounce` prop delays parsing after the last
|
|
28
|
+
search query change, so search-as-you-type can avoid re-parsing large
|
|
29
|
+
documents on every keystroke. The initial query still applies immediately for
|
|
30
|
+
server rendering.
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- `toc-change` no longer emits a transient empty array before the first parse
|
|
35
|
+
settles. A first document that really has no headings still emits one settled
|
|
36
|
+
`[]`. The TOC change check compares every field directly instead of
|
|
37
|
+
serializing the array.
|
|
38
|
+
- `customTagsPlugin()` and `MarkdownCustomTag` normalize kebab-case attributes
|
|
39
|
+
to camelCase props (`start-line` becomes `startLine`). `data-*` and `aria-*`
|
|
40
|
+
stay in their DOM form. The click payload and host component bindings use the
|
|
41
|
+
normalized props.
|
|
42
|
+
- `MermaidBlock` resets zoom on every render (retry, theme, renderer, and
|
|
43
|
+
source changes) and when returning from the source tab, not only when the
|
|
44
|
+
source text changes. The default error/fallback regions include a visible
|
|
45
|
+
retry button.
|
|
46
|
+
- The Mermaid runtime clears a rejected lazy import so retry can recover from a
|
|
47
|
+
transient chunk failure. Initialization is keyed by the full configuration
|
|
48
|
+
and checked inside the render queue, so blocks with different themes cannot
|
|
49
|
+
reuse stale global Mermaid state.
|
|
50
|
+
- `useMarkdownDocument` publishes a deduplicated diagnostics list for each run,
|
|
51
|
+
including failed runs, and exposes `clearDiagnostics()`. Entries count as
|
|
52
|
+
duplicates only when their code, message, severity, phase, plugin, source
|
|
53
|
+
range, and details all match, so distinct occurrences are preserved. Setup
|
|
54
|
+
diagnostics are snapshotted when plugin setup runs, so a plugin that retains
|
|
55
|
+
the setup context cannot append to the list on later runs. The renderer prunes
|
|
56
|
+
its reported-diagnostic set to the currently active entries instead of growing
|
|
57
|
+
it indefinitely.
|
|
58
|
+
- `MarkdownRendererEvents` and `MermaidBlockEvents` are exported typed event
|
|
59
|
+
maps, and the event payload conventions are documented so consumers do not
|
|
60
|
+
need to discover each shape separately. Interaction events include the
|
|
61
|
+
originating DOM event; the docs no longer claim every payload is serializable.
|
|
62
|
+
- The default `searchPlugin()` no longer walks the document tree when the query
|
|
63
|
+
is empty, and the renderer skips match counting for an empty query.
|
|
64
|
+
- A side TOC column now constrains its height and scrolls internally when the
|
|
65
|
+
table of contents is longer than the viewport. The stacked mobile layout
|
|
66
|
+
resets that cap so the TOC expands above the content.
|
|
67
|
+
- `MarkdownRenderer` now validates every scalar prop at runtime, not only the
|
|
68
|
+
enum props. Invalid enums, booleans, strings, and numeric values report a
|
|
69
|
+
`prop-*` warning and use the documented fallback instead of reaching the
|
|
70
|
+
renderer or pipeline. An omitted optional `baseUrl` is valid and emits no
|
|
71
|
+
diagnostic. The `externalLinkTarget` prop and document option are typed as
|
|
72
|
+
`'_self' | '_blank'` instead of `string`, and `theme` is inferred as a runtime
|
|
73
|
+
string prop.
|
|
74
|
+
- `MermaidBlock` invalidates in-flight renders on unmount, so a late result
|
|
75
|
+
cannot emit `rendered`/`error` or write state after the component is gone.
|
|
76
|
+
`resetMermaidRuntime()` keeps the serialized queue tail and monotonic render
|
|
77
|
+
counter, so an explicit reset cannot interleave renders or reuse DOM IDs.
|
|
78
|
+
- `mermaidPlugin()` rejects non-object arguments with a clear error instead of
|
|
79
|
+
silently ignoring them. Its only supported option remains `languages`.
|
|
80
|
+
- The built library no longer resolves Node-only dependency variants. This
|
|
81
|
+
removes `node:process`, `node:path`, and `node:url` imports (including
|
|
82
|
+
`process.cwd`) from browser output and prevents crashes when rendering.
|
|
83
|
+
- `renderMermaid()` and `MermaidBlock` now report a clear error for non-string
|
|
84
|
+
sources, such as an un-awaited `renderMermaid()` Promise, instead of throwing
|
|
85
|
+
`trim is not a function`. Empty and non-browser sources also explain how to
|
|
86
|
+
recover.
|
|
87
|
+
- `MermaidBlock` now distinguishes an invalid renderer result, empty renderer
|
|
88
|
+
output, and SVG rejected completely by sanitization, with an actionable hint
|
|
89
|
+
for each. Thrown renderer errors are prefixed with the failure stage. The
|
|
90
|
+
invalid `mermaidRenderer` diagnostic now names the actual fallback, the
|
|
91
|
+
built-in runtime.
|
|
92
|
+
- Default heading IDs collapse consecutive whitespace and hyphen runs, so
|
|
93
|
+
`My - Heading` becomes `my-heading` instead of `my-----heading`. Custom
|
|
94
|
+
sluggers keep their own formatting; only duplicate suffixes are added.
|
|
95
|
+
- The base renderer no longer statically includes the HTML parser. Mermaid SVG
|
|
96
|
+
sanitization loads it only after a diagram renders, the math entry uses it for
|
|
97
|
+
KaTeX markup, and the default highlight.js adapter now produces hast through
|
|
98
|
+
`lowlight` instead of parsing HTML. The highlight entry no longer pulls the
|
|
99
|
+
HTML parser, and the highlight entry resolves `highlight.js` language subpaths
|
|
100
|
+
from the host peer dependency instead of bundling a second copy.
|
|
101
|
+
- Published JavaScript no longer contains `sourceMappingURL` comments for maps
|
|
102
|
+
that are excluded from the tarball.
|
|
103
|
+
- The `highlight` entry no longer exports `highlightedNodesFromHtml`; adapters
|
|
104
|
+
that already produce hast use `highlightedNodesFromHast`. This keeps the HTML
|
|
105
|
+
parser out of the highlight entry.
|
|
106
|
+
|
|
107
|
+
### Documentation
|
|
108
|
+
|
|
109
|
+
- Document the Mermaid renderer layers and their precedence: per-block
|
|
110
|
+
`renderer` > provider/preset `mermaidRenderer` > built-in runtime. Clarify
|
|
111
|
+
that `mermaidPlugin()` only converts fences and that `renderMermaid()` is an
|
|
112
|
+
async function, not a `MermaidRenderer` object, so it must be wrapped when
|
|
113
|
+
passed explicitly. Explain why `resetMermaidRuntime()` is not a lifecycle
|
|
114
|
+
hook and cannot unload the browser module cache.
|
|
115
|
+
- Document the raw-HTML attribute casing rule: HTML lowercases attribute names,
|
|
116
|
+
so use kebab-case (`start-line`) for camelCase custom props (`startLine`).
|
|
117
|
+
- Add a complete sample plugin (`demo/plugins/samplePlugin.ts`) and a
|
|
118
|
+
step-by-step plugin guide that exercises source, remark, rehype, component,
|
|
119
|
+
document, label, token, setup/cleanup, and error hooks.
|
|
120
|
+
|
|
121
|
+
## [1.0.0] - 2026-11-01
|
|
122
|
+
|
|
123
|
+
First stable release of the Vue 3 Markdown component suite.
|
|
124
|
+
|
|
125
|
+
### Highlights
|
|
126
|
+
|
|
127
|
+
- Vue-native Markdown rendering through `unified`, `remark-parse`, and
|
|
128
|
+
`remark-rehype`; no HTML string round-trip and no `v-html` in the render path.
|
|
129
|
+
- A serializable, DOM-free document model shared by the renderer, headless
|
|
130
|
+
composables, and static HTML export.
|
|
131
|
+
- Customizable tag components, node components, function renderers, regions,
|
|
132
|
+
named slots, labels, tokens, presets, and inspectable manifests.
|
|
133
|
+
- TOC generation and navigation, search segmentation, custom tags, GFM,
|
|
134
|
+
frontmatter, footnotes, task items, filtering, URL policy, and static export.
|
|
135
|
+
- Optional highlight.js and Shiki adapters, `CodeBlock`,
|
|
136
|
+
`VueSyntaxHighlighter`, KaTeX math, Mermaid rendering, and the CodeMirror
|
|
137
|
+
Mermaid editor, each behind its own entry or lazy chunk.
|
|
138
|
+
- Sanitized raw HTML through the optional `@coderminer/vue-markdown/html` entry.
|
|
139
|
+
|
|
140
|
+
### Added
|
|
141
|
+
|
|
142
|
+
- `tocPlacement` with `top`, `left`, `right`, and `hidden` layouts.
|
|
143
|
+
- `search` and `searchCaseSensitive` renderer props plus the headless `search`
|
|
144
|
+
option.
|
|
145
|
+
- `search-change` event with `{ query, caseSensitive, matches }`.
|
|
146
|
+
- `math-error` event alongside the general diagnostic stream.
|
|
147
|
+
- Renderer parts `body` and `toc-column`; Mermaid/editor fullscreen parts
|
|
148
|
+
`mermaid-fullscreen` and `editor-fullscreen`.
|
|
149
|
+
- `MermaidLiveEditor` slots `toolbar`, `editor`, `preview`,
|
|
150
|
+
`editor-diagnostics`, `empty`, and `fullscreen`.
|
|
151
|
+
- `MermaidLiveEditor` options `rawDetails` and `autoFocus`, friendly diagnostic
|
|
152
|
+
labels, compact diagnostics, safe empty-state placeholders, and shared page
|
|
153
|
+
scroll locking across multiple fullscreen editors.
|
|
154
|
+
- Version consistency coverage across `package.json`, `package-lock.json`, and
|
|
155
|
+
the exported `version` constant.
|
|
156
|
+
|
|
157
|
+
### Changed
|
|
158
|
+
|
|
159
|
+
- `showError` now defaults to `true`, so failed renders show the error region by
|
|
160
|
+
default.
|
|
161
|
+
- `MarkdownRenderer` wraps content in a stable `[data-vmd-part="body"]` element
|
|
162
|
+
and places the TOC in `[data-vmd-part="toc-column"]`.
|
|
163
|
+
- `search-change` is emitted only when the rendered document belongs to the
|
|
164
|
+
current query. Pending or failed runs no longer report stale match counts.
|
|
165
|
+
- The explicit `search` option wins over segments produced by `searchPlugin()`;
|
|
166
|
+
disabling the plugin does not disable the explicit option.
|
|
167
|
+
- `MermaidLiveEditor` empty slots fall back correctly, including mounting
|
|
168
|
+
CodeMirror when the `editor` slot renders no content.
|
|
169
|
+
- Mermaid and editor fullscreen state now restores page scrolling and ignores
|
|
170
|
+
unrelated native fullscreen transitions.
|
|
171
|
+
|
|
172
|
+
### Breaking changes
|
|
173
|
+
|
|
174
|
+
- `skipHtml` is removed. Raw HTML is dropped by default and is enabled only by
|
|
175
|
+
adding `htmlPlugin()` from `@coderminer/vue-markdown/html`.
|
|
176
|
+
- `PipelineCapabilities.html`, `PipelineContext.allowHtml`, and the
|
|
177
|
+
normalization `allowHtml`/`skipHtml` options are removed.
|
|
178
|
+
- `rehype-raw` is an optional peer required only by the `html` entry. A manual
|
|
179
|
+
`rehype-raw` in `rehypePlugins` is ignored with a warning.
|
|
180
|
+
- The renderer markup now contains a `body` wrapper and a `toc-column` wrapper.
|
|
181
|
+
Host CSS should target stable `data-vmd-part` hooks instead of direct-child
|
|
182
|
+
structure such as `.vmd-root > .vmd-content`.
|
|
183
|
+
|
|
184
|
+
### Upgrade notes
|
|
185
|
+
|
|
186
|
+
Enable sanitized raw HTML explicitly:
|
|
187
|
+
|
|
188
|
+
```ts
|
|
189
|
+
import { htmlPlugin } from '@coderminer/vue-markdown/html'
|
|
190
|
+
|
|
191
|
+
const plugins = [...defaultPlugins, htmlPlugin()]
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Install the optional parser when this entry is used:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
npm install rehype-raw
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Hide the error region if the previous default is required:
|
|
201
|
+
|
|
202
|
+
```vue
|
|
203
|
+
<MarkdownRenderer :source="source" :show-error="false" />
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Replace structural selectors with the documented parts:
|
|
207
|
+
|
|
208
|
+
```css
|
|
209
|
+
[data-vmd-part='content'] {
|
|
210
|
+
/* content */
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
[data-vmd-part='toc-column'] {
|
|
214
|
+
/* TOC layout column */
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
For search-as-you-type on large documents, debounce the `search` prop. Search
|
|
219
|
+
participates in the parse memo key, so each settled query change re-parses the
|
|
220
|
+
document.
|
|
221
|
+
|
|
222
|
+
### Verification
|
|
223
|
+
|
|
224
|
+
The release passes the Node and happy-dom test projects, type checking, lint,
|
|
225
|
+
library/demo/docs builds, the bundle-size guard, benchmarks, and OpenSpec
|
|
226
|
+
validation.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 CoderMiner
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|