@jx3box/jx3box-editor 1.0.3 → 1.0.7
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/assets/js/a.js +7 -0
- package/assets/js/directory.js +1 -1
- package/package.json +2 -2
- package/src/ArticleMarkdown.vue +3 -18
- package/src/Markdown.vue +2 -2
package/assets/js/a.js
CHANGED
|
@@ -18,11 +18,18 @@ function formatLink(str){
|
|
|
18
18
|
href = resolveImagePath(href)
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
|
|
21
22
|
let skip = ''
|
|
22
23
|
if(!whiteHost.test(to.hostname)){
|
|
23
24
|
skip = 'target="_blank"'
|
|
24
25
|
}
|
|
25
26
|
|
|
27
|
+
// markdown中的锚点跳转
|
|
28
|
+
let isHashAnchor = href.startsWith('#')
|
|
29
|
+
if(isHashAnchor){
|
|
30
|
+
skip = 'target="_self"'
|
|
31
|
+
}
|
|
32
|
+
|
|
26
33
|
let suffix = item[3]
|
|
27
34
|
let text = item[4]
|
|
28
35
|
|
package/assets/js/directory.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jx3box/jx3box-editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "JX3BOX Article & Editor",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@jx3box/jx3box-emotion": "^1.0.10",
|
|
37
37
|
"@jx3box/jx3box-macro": "^1.0.1",
|
|
38
38
|
"@jx3box/jx3box-talent": "^1.1.2",
|
|
39
|
-
"@jx3box/markdown": "^0.1.
|
|
39
|
+
"@jx3box/markdown": "^0.1.5",
|
|
40
40
|
"@tinymce/tinymce-vue": "^3.2.2",
|
|
41
41
|
"axios": "^0.19.2",
|
|
42
42
|
"core-js": "^3.6.5",
|
package/src/ArticleMarkdown.vue
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="c-article-markdown">
|
|
3
|
-
<markdown-render class="c-markdown" ref="article" v-model="origin" @change="updateOrigin"></markdown-render>
|
|
3
|
+
<markdown-render id="c-article" class="c-markdown" ref="article" v-model="origin" @change="updateOrigin" :preRender="doReg"></markdown-render>
|
|
4
4
|
<div class="w-jx3-element-pop" :style="jx3_element.style">
|
|
5
5
|
<jx3-item :item_id="item.id" :jx3ClientType="item.client" v-show="jx3_element.type == 'item'" />
|
|
6
6
|
<jx3-buff :client="buff.client" :id="buff.id" :level="buff.level" v-show="jx3_element.type == 'buff'" />
|
|
@@ -44,10 +44,8 @@ export default {
|
|
|
44
44
|
return {
|
|
45
45
|
// 原始md
|
|
46
46
|
origin : '',
|
|
47
|
-
// 原始渲染md后的html
|
|
47
|
+
// 原始渲染md后的html(传入文本回调处理函数)
|
|
48
48
|
html: "",
|
|
49
|
-
// 文本处理后的html
|
|
50
|
-
data: "",
|
|
51
49
|
|
|
52
50
|
// 物品
|
|
53
51
|
item: {
|
|
@@ -107,14 +105,7 @@ export default {
|
|
|
107
105
|
renderJx3Element(this);
|
|
108
106
|
},
|
|
109
107
|
doDir: function() {
|
|
110
|
-
|
|
111
|
-
let target = "";
|
|
112
|
-
if (this.hasPages && !this.all) {
|
|
113
|
-
target = "#c-article-part" + this.page;
|
|
114
|
-
// 全部
|
|
115
|
-
} else {
|
|
116
|
-
target = "#c-article";
|
|
117
|
-
}
|
|
108
|
+
let target = "#c-article";
|
|
118
109
|
let dir = renderDirectory(target, this.directorybox);
|
|
119
110
|
if (dir) this.$emit("directoryRendered");
|
|
120
111
|
},
|
|
@@ -123,12 +114,6 @@ export default {
|
|
|
123
114
|
this.render()
|
|
124
115
|
},
|
|
125
116
|
render: function() {
|
|
126
|
-
let result = this.doReg(this.html);
|
|
127
|
-
this.data = result;
|
|
128
|
-
|
|
129
|
-
// TODO: 过滤未展示
|
|
130
|
-
this.$forceUpdate()
|
|
131
|
-
|
|
132
117
|
// 等待html加载完毕后
|
|
133
118
|
this.$nextTick(() => {
|
|
134
119
|
this.$emit("contentLoaded");
|
package/src/Markdown.vue
CHANGED
|
@@ -35,8 +35,8 @@ import Upload from "./Upload";
|
|
|
35
35
|
import Resource from "./Resource";
|
|
36
36
|
|
|
37
37
|
// jx3
|
|
38
|
-
import macro from '
|
|
39
|
-
import pz from '
|
|
38
|
+
// import macro from './components/markdown/macro.vue'
|
|
39
|
+
// import pz from './components/markdown/pz.vue'
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
export default {
|