diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts index 264b5769e..2f4aedc1c 100644 --- a/app/src/protyle/util/editorCommonEvent.ts +++ b/app/src/protyle/util/editorCommonEvent.ts @@ -177,11 +177,11 @@ const moveTo = async (protyle: IProtyle, sourceElements: Element[], targetElemen if (position === "afterend" && targetElement.getAttribute("data-type") === "NodeHeading" && targetElement.getAttribute("fold") === "1") { - ignoreInsert = targetElement.getAttribute("data-subtype").replace("h", ""); + ignoreInsert = targetElement.getAttribute("data-subtype")?.replace("h", ""); } else if (position === "beforebegin" && targetElement.previousElementSibling && targetElement.previousElementSibling.getAttribute("data-type") === "NodeHeading" && targetElement.previousElementSibling.getAttribute("fold") === "1") { - ignoreInsert = targetElement.getAttribute("data-subtype").replace("h", ""); + ignoreInsert = targetElement.getAttribute("data-subtype")?.replace("h", ""); } if (ignoreInsert) { let breakIgnore = false; diff --git a/kernel/api/lute.go b/kernel/api/lute.go index 4c63849c8..f9c19c608 100644 --- a/kernel/api/lute.go +++ b/kernel/api/lute.go @@ -79,7 +79,7 @@ func html2BlockDOM(c *gin.Context) { dom := arg["dom"].(string) luteEngine := util.NewLute() luteEngine.SetHTMLTag2TextMark(true) - luteEngine.SetHTML2MarkdownAttrs([]string{"name", "alias", "memo", "bookmark", "custom-*"}) + luteEngine.SetHTML2MarkdownAttrs([]string{"alias", "memo", "bookmark", "custom-*"}) markdown, withMath, err := model.HTML2Markdown(dom, luteEngine) if err != nil { ret.Data = "Failed to convert" diff --git a/kernel/conf/export.go b/kernel/conf/export.go index 06f71eb15..4daa15f93 100644 --- a/kernel/conf/export.go +++ b/kernel/conf/export.go @@ -34,7 +34,7 @@ type Export struct { FileAnnotationRefMode int `json:"fileAnnotationRefMode"` // 文件标注引用导出模式,0:文件名 - 页码 - 锚文本,1:仅锚文本 PandocBin string `json:"pandocBin"` // Pandoc 可执行文件路径 MarkdownYFM bool `json:"markdownYFM"` // Markdown 导出时是否添加 YAML Front Matter https://github.com/siyuan-note/siyuan/issues/7727 - InlineMemo bool `json:"inlineMemo"` // 是否导出行级备忘录 https://github.com/siyuan-note/siyuan/issues/14605 + InlineMemo bool `json:"inlineMemo"` // 是否导出行级备注 https://github.com/siyuan-note/siyuan/issues/14605 PDFFooter string `json:"pdfFooter"` // PDF 导出时页脚内容 DocxTemplate string `json:"docxTemplate"` // Docx 导出时模板文件路径 PDFWatermarkStr string `json:"pdfWatermarkStr"` // PDF 导出时水印文本或水印文件路径 diff --git a/kernel/model/export.go b/kernel/model/export.go index 5080766ef..f95fb31a4 100644 --- a/kernel/model/export.go +++ b/kernel/model/export.go @@ -2273,10 +2273,9 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool, case 2: // 锚文本块链 blockRefLink := &ast.Node{Type: ast.NodeTextMark, TextMarkTextContent: linkText, TextMarkAHref: "siyuan://blocks/" + defID} blockRefLink.KramdownIAL = n.KramdownIAL - if "block-ref" != n.TextMarkType { // 除了块引还有其他元素 https://github.com/siyuan-note/siyuan/issues/15698 - blockRefLink.TextMarkType = strings.TrimSpace(strings.ReplaceAll(n.TextMarkType, "block-ref", "a")) - blockRefLink.TextMarkInlineMemoContent = n.TextMarkInlineMemoContent - } + // 除了块引还有其他元素 https://github.com/siyuan-note/siyuan/issues/15698 + blockRefLink.TextMarkType = strings.TrimSpace(strings.ReplaceAll(n.TextMarkType, "block-ref", "a")) + blockRefLink.TextMarkInlineMemoContent = n.TextMarkInlineMemoContent n.InsertBefore(blockRefLink) unlinks = append(unlinks, n) case 3: // 仅锚文本