mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-27 20:08:49 +01:00
🐛 复制含链接的块为引用块异常 Fix https://github.com/siyuan-note/siyuan/issues/7426
This commit is contained in:
parent
740761fcc8
commit
6faff1109c
5 changed files with 11 additions and 15 deletions
|
|
@ -114,12 +114,6 @@ func IsEmbedBlockRef(n *ast.Node) bool {
|
|||
return "" != GetEmbedBlockRef(n)
|
||||
}
|
||||
|
||||
func NodeStaticMdContent(node *ast.Node, luteEngine *lute.Lute) (md, content string) {
|
||||
md = ExportNodeStdMd(node, luteEngine)
|
||||
content = NodeStaticContent(node, nil)
|
||||
return
|
||||
}
|
||||
|
||||
func FormatNode(node *ast.Node, luteEngine *lute.Lute) string {
|
||||
markdown, err := lute.FormatNodeSync(node, luteEngine.ParseOptions, luteEngine.RenderOptions)
|
||||
if nil != err {
|
||||
|
|
@ -138,7 +132,7 @@ func ExportNodeStdMd(node *ast.Node, luteEngine *lute.Lute) string {
|
|||
return markdown
|
||||
}
|
||||
|
||||
func NodeStaticContent(node *ast.Node, excludeTypes []string) string {
|
||||
func NodeStaticContent(node *ast.Node, excludeTypes []string, includeTextMarkATitleURL bool) string {
|
||||
if nil == node {
|
||||
return ""
|
||||
}
|
||||
|
|
@ -225,7 +219,7 @@ func NodeStaticContent(node *ast.Node, excludeTypes []string) string {
|
|||
if n.IsTextMarkType("tag") {
|
||||
buf.WriteByte('#')
|
||||
}
|
||||
if n.IsTextMarkType("a") {
|
||||
if n.IsTextMarkType("a") && includeTextMarkATitleURL {
|
||||
// 搜索不到超链接元素的 URL 和标题 https://github.com/siyuan-note/siyuan/issues/7352
|
||||
if "" != n.TextMarkATitle {
|
||||
buf.WriteString(" " + n.TextMarkATitle)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue