Compare commits

...

5 commits

Author SHA1 Message Date
Vanessa
67f232076e Merge remote-tracking branch 'origin/dev' into dev 2025-09-18 19:57:07 +08:00
Vanessa
8ea8db64ec 🎨 https://github.com/siyuan-note/siyuan/issues/15873 2025-09-18 19:56:53 +08:00
Daniel
76372ae017
🎨 https://github.com/siyuan-note/siyuan/issues/15866
Signed-off-by: Daniel <845765@qq.com>
2025-09-18 16:46:50 +08:00
Daniel
4689c1fa18
🎨 Clean code
Signed-off-by: Daniel <845765@qq.com>
2025-09-18 16:38:07 +08:00
Daniel
5b19ff6b8a
🎨 Block ref elements retain their original styles when exported https://github.com/siyuan-note/siyuan/issues/15698
Signed-off-by: Daniel <845765@qq.com>
2025-09-18 16:38:07 +08:00
4 changed files with 7 additions and 8 deletions

View file

@ -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;

View file

@ -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"

View file

@ -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 导出时水印文本或水印文件路径

View file

@ -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: // 仅锚文本