markdown-it-vue3 1.0.0 → 1.1.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/LICENSE ADDED
@@ -0,0 +1,31 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nico
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.
22
+
23
+ -------------------------------------------------------------------------------
24
+
25
+ Third-Party Copyright Notice
26
+
27
+ This project includes code based on or referenced from ravenq/markdown-it-vue,
28
+ which is licensed under the MIT License:
29
+ https://github.com/ravenq/markdown-it-vue/blob/master/LICENSE
30
+
31
+ Copyright (c) 2019 ravenq
package/README.md CHANGED
@@ -1,6 +1,24 @@
1
1
  # markdown-it-vue3
2
+ [![npm version](https://img.shields.io/npm/v/markdown-it-vue3)](https://www.npmjs.com/package/markdown-it-vue3)
3
+ [![license](https://img.shields.io/npm/l/markdown-it-vue3)](https://www.npmjs.com/package/markdown-it-vue3)
4
+ [![vue 3](https://img.shields.io/badge/vue-3.x-42b883)](https://vuejs.org/)
2
5
 
3
- > Vue 3 markdown rendering library based on [markdown-it](https://github.com/markdown-it/markdown-it)
6
+
7
+ > Vue3 版本的 markdown 流式渲染组件。<br>
8
+ > A Vue 3 markdown rendering component support streaming, built on top of [markdown-it](https://github.com/markdown-it/markdown-it)
9
+
10
+ ## Features
11
+
12
+ - Emoji, Subscript, Superscript, Footnotes
13
+ - Task lists, Definition lists
14
+ - KaTeX/LaTeX math
15
+ - Mermaid, ECharts, Flowchart diagrams
16
+ - Code highlighting with copy button
17
+ - Image viewer
18
+ - Alert containers: `::: success/info/warning/error`
19
+ - **Streaming support** for AI chat scenarios
20
+
21
+ * Demo: https://niyongsheng.github.io/markdown-it-vue3/
4
22
 
5
23
  ## Install
6
24
 
@@ -10,61 +28,43 @@ npm install markdown-it-vue3
10
28
 
11
29
  ## Usage
12
30
 
31
+ ### Static Markdown
32
+
13
33
  ```vue
14
34
  <template>
15
- <markdown-it-vue :content="content" />
35
+ <MarkdownItVue :content="content" />
16
36
  </template>
17
37
 
18
- <script>
38
+ <script setup>
19
39
  import MarkdownItVue from 'markdown-it-vue3'
20
40
  import 'markdown-it-vue3/dist/markdown-it-vue3.css'
21
41
 
22
- export default {
23
- components: { MarkdownItVue },
24
- data() {
25
- return { content: '# Hello World' }
26
- }
27
- }
42
+ const content = '# Hello World'
28
43
  </script>
29
44
  ```
30
45
 
31
- ## Light Version
32
-
33
- Smaller bundle without Mermaid, ECharts, Flowchart:
34
-
35
- ```javascript
36
- import MarkdownItVueLight from 'markdown-it-vue3/dist/markdown-it-vue3-light'
37
- import 'markdown-it-vue3/dist/markdown-it-vue3-light.css'
38
- ```
46
+ ### Streaming Markdown (AI Chat)
39
47
 
40
- ## Props
41
-
42
- | Prop | Type | Default | Description |
43
- |------|------|---------|-------------|
44
- | content | String | `''` | Markdown content |
45
- | options | Object | `{}` | Configuration |
48
+ ```vue
49
+ <template>
50
+ <MarkdownItVueStreaming
51
+ :content="streamContent"
52
+ :streaming="isStreaming"
53
+ @render-complete="onComplete"
54
+ />
55
+ </template>
46
56
 
47
- ## Options
57
+ <script setup>
58
+ import { ref } from 'vue'
59
+ import { MarkdownItVueStreaming } from 'markdown-it-vue3'
60
+ import 'markdown-it-vue3/dist/markdown-it-vue3.css'
48
61
 
49
- ```javascript
50
- {
51
- markdownIt: { linkify: true },
52
- katex: { throwOnError: false },
53
- githubToc: { tocFirstLevel: 2, tocLastLevel: 3 },
54
- mermaid: { theme: 'default' },
55
- image: { viewer: true }
56
- }
62
+ const streamContent = ref('')
63
+ const isStreaming = ref(false)
64
+ </script>
57
65
  ```
58
66
 
59
- ## Features
60
-
61
- - Emoji, Subscript, Superscript, Footnotes
62
- - Task lists, Definition lists
63
- - KaTeX/LaTeX math
64
- - Mermaid, ECharts, Flowchart diagrams
65
- - Code highlighting
66
- - Image viewer
67
- - Alert containers: `::: success/info/warning/error`
67
+ > 📖 **See [example](./example) for complete implementation**
68
68
 
69
69
  ## License
70
70
 
package/dist/demo.html CHANGED
@@ -1 +1 @@
1
- <!doctype html><meta charset="utf-8"><title>markdown-it-vue3-light demo</title><script src="./markdown-it-vue3-light.umd.js"></script><link rel="stylesheet" href="./markdown-it-vue3-light.css"><script>console.log(markdown-it-vue3-light)</script>
1
+ <!doctype html><meta charset="utf-8"><title>markdown-it-vue3 demo</title><script src="./markdown-it-vue3.umd.js"></script><link rel="stylesheet" href="./markdown-it-vue3.css"><script>console.log(markdown-it-vue3)</script>