mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
Compare commits
5 commits
1f69a87cc5
...
67f232076e
Author | SHA1 | Date | |
---|---|---|---|
![]() |
67f232076e | ||
![]() |
8ea8db64ec | ||
![]() |
76372ae017 | ||
![]() |
4689c1fa18 | ||
![]() |
5b19ff6b8a |
4 changed files with 7 additions and 8 deletions
|
@ -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;
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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 导出时水印文本或水印文件路径
|
||||
|
|
|
@ -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: // 仅锚文本
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue