mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 15:10:12 +01:00
🎨 Improve block ref text copying https://github.com/siyuan-note/siyuan/issues/11473
This commit is contained in:
parent
0686a28904
commit
49bb5d56a4
1 changed files with 11 additions and 0 deletions
|
|
@ -20,6 +20,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/88250/gulu"
|
"github.com/88250/gulu"
|
||||||
"github.com/88250/lute/html"
|
"github.com/88250/lute/html"
|
||||||
|
|
@ -352,7 +353,17 @@ func getRefText(c *gin.Context) {
|
||||||
if "" == refText {
|
if "" == refText {
|
||||||
// 空块返回 id https://github.com/siyuan-note/siyuan/issues/10259
|
// 空块返回 id https://github.com/siyuan-note/siyuan/issues/10259
|
||||||
refText = id
|
refText = id
|
||||||
|
ret.Data = refText
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if strings.Count(refText, "\\") == len(refText) {
|
||||||
|
// 全部都是 \ 的话使用实体 https://github.com/siyuan-note/siyuan/issues/11473
|
||||||
|
refText = strings.ReplaceAll(refText, "\\", "\")
|
||||||
|
ret.Data = refText
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
ret.Data = refText
|
ret.Data = refText
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue