mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-21 19:41:05 +08:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
c36d397877
@ -1,4 +1,4 @@
|
|||||||
export const addScriptSync = (path: string, id: string) => {
|
export const addScriptSync = async (path: string, id: string) => {
|
||||||
if (document.getElementById(id)) {
|
if (document.getElementById(id)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -12,6 +12,10 @@ export const addScriptSync = (path: string, id: string) => {
|
|||||||
scriptElement.text = xhrObj.responseText;
|
scriptElement.text = xhrObj.responseText;
|
||||||
scriptElement.id = id;
|
scriptElement.id = id;
|
||||||
document.head.appendChild(scriptElement);
|
document.head.appendChild(scriptElement);
|
||||||
|
if (typeof Lute === "undefined") {
|
||||||
|
// 鸿蒙系统上第一次加载会出现 Lute 未定义的情况,重新载入一次就好了,暂时没找到原因,先这样处理
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const addScript = (path: string, id: string) => {
|
export const addScript = (path: string, id: string) => {
|
||||||
|
@ -768,13 +768,22 @@ func ExportMarkdownHTML(id, savePath string, docx, merge bool) (name, dom string
|
|||||||
luteEngine := NewLute()
|
luteEngine := NewLute()
|
||||||
luteEngine.SetFootnotes(true)
|
luteEngine.SetFootnotes(true)
|
||||||
|
|
||||||
// 自定义表情图片地址去掉开头的 /
|
|
||||||
ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {
|
ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {
|
||||||
if !entering {
|
if !entering {
|
||||||
return ast.WalkContinue
|
return ast.WalkContinue
|
||||||
}
|
}
|
||||||
if ast.NodeEmojiImg == n.Type {
|
if ast.NodeEmojiImg == n.Type {
|
||||||
|
// 自定义表情图片地址去掉开头的 /
|
||||||
n.Tokens = bytes.ReplaceAll(n.Tokens, []byte("src=\"/emojis"), []byte("src=\"emojis"))
|
n.Tokens = bytes.ReplaceAll(n.Tokens, []byte("src=\"/emojis"), []byte("src=\"emojis"))
|
||||||
|
} else if ast.NodeList == n.Type {
|
||||||
|
if nil != n.ListData && 1 == n.ListData.Typ {
|
||||||
|
if 0 == n.ListData.Start {
|
||||||
|
n.ListData.Start = 1
|
||||||
|
}
|
||||||
|
if li := n.ChildByType(ast.NodeListItem); nil != li && nil != li.ListData {
|
||||||
|
n.ListData.Start = li.ListData.Num
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ast.WalkContinue
|
return ast.WalkContinue
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user