vditor 3.8.15 → 3.8.16
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 +9 -8
- package/dist/index.css +1 -1
- package/dist/index.min.js +1 -1
- package/dist/js/lute/lute.min.js +47 -47
- package/dist/method.min.js +1 -1
- package/dist/types/index.d.ts +4 -2
- package/package.json +1 -1
- package/src/ts/ir/input.ts +23 -14
- package/src/ts/sv/inputEvent.ts +16 -15
- package/src/ts/sv/process.ts +20 -8
- package/src/ts/util/fixBrowserBehavior.ts +2 -2
- package/src/ts/wysiwyg/index.ts +4 -0
- package/src/ts/wysiwyg/input.ts +16 -14
package/README.md
CHANGED
|
@@ -114,6 +114,7 @@ Vditor 在这些方面做了努力,希望能为现代化的通用 Markdown 编
|
|
|
114
114
|
|
|
115
115
|
* [Sym](https://github.com/88250/symphony) 一款用 Java 实现的现代化社区(论坛/BBS/社交网络/博客)平台
|
|
116
116
|
* [Solo](https://github.com/88250/solo) & [Pipe](https://github.com/88250/pipe) B3log 分布式社区的博客端节点,欢迎加入下一代社区网络
|
|
117
|
+
* [Tditor](https://tditor.com) 基于React、Vditor、Springboot, 一款打造极致文字创作体验的在线Markdown编辑平台
|
|
117
118
|
* [Arya](https://github.com/nicejade/markdown-online-editor) 基于 Vue、Vditor,所构建的在线 Markdown 编辑器
|
|
118
119
|
* [更多案例](https://github.com/Vanessa219/vditor/network/dependents?package_id=UGFja2FnZS0zMTY2Mzg4MzE%3D)
|
|
119
120
|
|
|
@@ -141,9 +142,9 @@ const vditor = new Vditor(id, {options...})
|
|
|
141
142
|
* 在 HTML 中插入 CSS 和 JavaScript,可参考 [demo](https://b3log.org/vditor/demo/index.html)
|
|
142
143
|
|
|
143
144
|
```html
|
|
144
|
-
<!-- ⚠️生产环境请指定版本号,如 https://
|
|
145
|
-
<link rel="stylesheet" href="https://
|
|
146
|
-
<script src="https://
|
|
145
|
+
<!-- ⚠️生产环境请指定版本号,如 https://unpkg.com/vditor@x.x.x/dist... -->
|
|
146
|
+
<link rel="stylesheet" href="https://unpkg.com/vditor/dist/index.css" />
|
|
147
|
+
<script src="https://unpkg.com/vditor/dist/index.min.js"></script>
|
|
147
148
|
```
|
|
148
149
|
|
|
149
150
|
### 示例代码
|
|
@@ -209,7 +210,7 @@ Markdown 输出的 HTML 所展现的外观。内置 ant-design, light,dark,w
|
|
|
209
210
|
| select(value: string) | 编辑器中选中文字后触发 | - |
|
|
210
211
|
| tab | <kbd>tab</kbd> 键操作字符串,支持 `\t` 及任意字符串 | - |
|
|
211
212
|
| typewriterMode | 是否启用打字机模式 | false |
|
|
212
|
-
| cdn | 配置自建 CDN 地址 | `https://
|
|
213
|
+
| cdn | 配置自建 CDN 地址 | `https://unpkg.com/vditor@${VDITOR_VERSION}` |
|
|
213
214
|
| mode | 可选模式:sv, ir, wysiwyg | 'ir' |
|
|
214
215
|
| debugger | 是否显示日志 | false |
|
|
215
216
|
| value | 编辑器初始化值 | '' |
|
|
@@ -328,7 +329,7 @@ new Vditor('vditor', {
|
|
|
328
329
|
| - | - | - |
|
|
329
330
|
| current | 当前主题 | "light" |
|
|
330
331
|
| list | 可选主题列表 | { "ant-design": "Ant Design", dark: "Dark", light: "Light", wechat: "WeChat" } |
|
|
331
|
-
| path | 主题样式地址 | `https://
|
|
332
|
+
| path | 主题样式地址 | `https://unpkg.com/vditor@${VDITOR_VERSION}/dist/css/content-theme` |
|
|
332
333
|
|
|
333
334
|
#### options.preview.math
|
|
334
335
|
|
|
@@ -359,7 +360,7 @@ new Vditor('vditor', {
|
|
|
359
360
|
| delay | 提示 debounce 毫秒间隔 | 200 |
|
|
360
361
|
| emoji | 默认表情,可从[lute/emoji_map](https://github.com/88250/lute/blob/master/parse/emoji_map.go) 中选取,也可自定义 | { '+1': '👍', '-1': '👎', 'heart': '❤️', 'cold_sweat': '😰' } |
|
|
361
362
|
| emojiTail | 常用表情提示 | - |
|
|
362
|
-
| emojiPath | 表情图片地址 | `https://
|
|
363
|
+
| emojiPath | 表情图片地址 | `https://unpkg.com/vditor@${VDITOR_VERSION}/dist/images/emoji` |
|
|
363
364
|
| extend: IHintExtend[] | 对 @/话题等关键字自动补全的扩展 | [] |
|
|
364
365
|
|
|
365
366
|
```ts
|
|
@@ -520,7 +521,7 @@ if (xhr.status === 200) {
|
|
|
520
521
|
|
|
521
522
|
#### static methods
|
|
522
523
|
|
|
523
|
-
* 不需要进行编辑操作时,仅需引入 [`method.min.js`](https://
|
|
524
|
+
* 不需要进行编辑操作时,仅需引入 [`method.min.js`](https://unpkg.com/vditor/dist/) 后如下直接调用
|
|
524
525
|
|
|
525
526
|
```js
|
|
526
527
|
Vditor.mermaidRender(document)
|
|
@@ -600,7 +601,7 @@ options?: IPreviewOptions {
|
|
|
600
601
|
|
|
601
602
|
### CDN 切换
|
|
602
603
|
|
|
603
|
-
由于使用了按需加载的机制,默认 CDN 为 [https://
|
|
604
|
+
由于使用了按需加载的机制,默认 CDN 为 [https://unpkg.com/vditor](https://unpkg.com/vditor)@版本号
|
|
604
605
|
|
|
605
606
|
如果代码有修改或需要使用自建 CDN 的话,可按以下步骤进行操作:
|
|
606
607
|
|
package/dist/index.css
CHANGED