🎨 Database primary key anchor text supports line breaks https://github.com/siyuan-note/siyuan/issues/13624

This commit is contained in:
Daniel 2025-01-02 11:10:16 +08:00
parent 6125603e38
commit 07cd4ec0b5
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
5 changed files with 23 additions and 13 deletions

View file

@ -103,14 +103,16 @@ func renderOutline(heading *ast.Node, luteEngine *lute.Lute) (ret string) {
return
}
func renderBlockText(node *ast.Node, excludeTypes []string) (ret string) {
func renderBlockText(node *ast.Node, excludeTypes []string, removeLineBreak bool) (ret string) {
if nil == node {
return
}
ret = sql.NodeStaticContent(node, excludeTypes, false, false, false)
ret = strings.TrimSpace(ret)
ret = strings.ReplaceAll(ret, "\n", "")
if removeLineBreak {
ret = strings.ReplaceAll(ret, "\n", "")
}
ret = util.UnescapeHTML(ret)
ret = util.EscapeHTML(ret)
ret = strings.TrimSpace(ret)