@bhsd/codemirror-mediawiki 2.30.1 → 2.30.3
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/dist/bidi.d.ts +1 -1
- package/dist/hover.js +2 -4
- package/dist/main.min.js +18 -18
- package/dist/mw.min.js +20 -20
- package/dist/token.js +1 -1
- package/dist/wiki.min.js +20 -20
- package/i18n/en.json +1 -1
- package/i18n/zh-hans.json +1 -1
- package/i18n/zh-hant.json +1 -1
- package/mediawiki.css +1 -1
- package/package.json +13 -13
package/dist/bidi.d.ts
CHANGED
package/dist/hover.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { hoverTooltip } from '@codemirror/view';
|
|
2
2
|
import { loadScript, getLSP } from '@bhsd/common';
|
|
3
|
-
let md;
|
|
4
3
|
/**
|
|
5
4
|
* 将索引转换为位置
|
|
6
5
|
* @param doc Text 实例
|
|
@@ -36,15 +35,14 @@ export default (cm) => hoverTooltip(async (view, pos) => {
|
|
|
36
35
|
const { state: { doc } } = view, hover = await getLSP(view, false, cm.getWikiConfig)
|
|
37
36
|
?.provideHover(doc.toString(), indexToPos(doc, pos));
|
|
38
37
|
if (hover) {
|
|
39
|
-
await loadScript('npm/
|
|
40
|
-
md ??= markdownit();
|
|
38
|
+
await loadScript('npm/marked/lib/marked.umd.js', 'marked', true);
|
|
41
39
|
const { end } = hover.range;
|
|
42
40
|
return {
|
|
43
41
|
pos,
|
|
44
42
|
end: posToIndex(doc, end),
|
|
45
43
|
above: true,
|
|
46
44
|
create() {
|
|
47
|
-
return createTooltipView(view,
|
|
45
|
+
return createTooltipView(view, marked.parse(hover.contents.value));
|
|
48
46
|
},
|
|
49
47
|
};
|
|
50
48
|
}
|