Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve error tip when renaming tags/bookmarks containing Markdown markers Fix https://github.com/siyuan-note/siyuan/issues/9248

Daniel3ecebb224a9e
diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100635-ms0p9lb.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100635-ms0p9lb.sy
index dbfe35e4b6..bbed8c7af3 100644
--- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100635-ms0p9lb.sy
+++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100635-ms0p9lb.sy
@@ -6,7 +6,7 @@
"id": "20200924100635-ms0p9lb",
"title": "Bookmark and Tag",
"type": "doc",
- "updated": "20210702231509"
+ "updated": "20230928114919"
},
"Children": [
{
@@ -182,6 +182,202 @@
"Data": "). If you need to cancel the tag, just delete the tag in the content block."
}
]
+ },
+ {
+ "ID": "20230928113947-gnlob5l",
+ "Type": "NodeHeading",
+ "HeadingLevel": 2,
+ "Properties": {
+ "id": "20230928113947-gnlob5l",
+ "updated": "20230928113958"
+ },
+ "Children": [
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "tag",
+ "TextMarkTextContent": "Note"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​"
+ }
+ ]
+ },
+ {
+ "ID": "20230928113959-ebzf9zy",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20230928113959-ebzf9zy",
+ "updated": "20230928114919"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Do not use special symbols in bookmarks or tags, otherwise renaming in the bookmark or tag panel will not be possible. The \"special symbols\" here include: "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "*"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​, "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "_"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​, "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "["
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​, "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "]"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​, "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "!"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​, "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "\\"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​, "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "`"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​ , "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "\u0026lt;"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​, "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "\u0026gt;"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​, "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "\u0026amp;"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​, "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "~ "
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​, "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "$"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​, "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "("
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​, "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": ")"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​, "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "{"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​, "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "}"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​, "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "="
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​ and "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "#"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​."
+ }
+ ]
}
]
}
\ No newline at end of file
diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200910201551-h4twhas.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200910201551-h4twhas.sy
index ba90c791e9..7687749a4a 100644
--- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200910201551-h4twhas.sy
+++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200910201551-h4twhas.sy
@@ -6,7 +6,7 @@
"id": "20200910201551-h4twhas",
"title": "书签和标签",
"type": "doc",
- "updated": "20210702231322"
+ "updated": "20230928114656"
},
"Children": [
{
@@ -182,6 +182,202 @@
"Data": ")中列出。如果需要取消标签,在内容块中删掉该标签即可。"
}
]
+ },
+ {
+ "ID": "20230928114125-0cw4gus",
+ "Type": "NodeHeading",
+ "HeadingLevel": 2,
+ "Properties": {
+ "id": "20230928114125-0cw4gus",
+ "updated": "20230928114129"
+ },
+ "Children": [
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "tag",
+ "TextMarkTextContent": "注意"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​"
+ }
+ ]
+ },
+ {
+ "ID": "20230928114129-dirvllf",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20230928114129-dirvllf",
+ "updated": "20230928114656"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "请勿在书签或者标签中使用特殊符号,否则会导致无法在书签或标签面板中重命名。这里的“特殊符号”包括:"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "*"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "_"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "["
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "]"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "!"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "\\"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "`"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "\u0026lt;"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "\u0026gt;"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "\u0026amp;"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "~"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "$"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "("
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": ")"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "{"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "}"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "="
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​ 和 "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "#"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​。"
+ }
+ ]
}
]
}
\ No newline at end of file
diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226123130-jpeg5b2.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226123130-jpeg5b2.sy
index f44536ae25..5e44b5bd53 100644
--- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226123130-jpeg5b2.sy
+++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226123130-jpeg5b2.sy
@@ -5,7 +5,7 @@
"Properties": {
"id": "20211226123130-jpeg5b2",
"title": "書籤和標籤",
- "updated": "20211226123145"
+ "updated": "20230928114931"
},
"Children": [
{
@@ -167,7 +167,7 @@
},
{
"Type": "NodeText",
- "Data": " / "
+ "Data": "​ / "
},
{
"Type": "NodeTextMark",
@@ -176,7 +176,207 @@
},
{
"Type": "NodeText",
- "Data": ")中列出。如果需要取消標簽,在內容塊中刪掉該標簽即可。"
+ "Data": "​)中列出。如果需要取消標簽,在內容塊中刪掉該標簽即可。"
+ }
+ ]
+ },
+ {
+ "ID": "20230928114735-uks4kf5",
+ "Type": "NodeHeading",
+ "HeadingLevel": 2,
+ "Properties": {
+ "id": "20230928114735-uks4kf5",
+ "updated": "20230928114758"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "​"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "tag",
+ "TextMarkTextContent": "注意"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​"
+ }
+ ]
+ },
+ {
+ "ID": "20230928114731-0nurd8j",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20230928114731-0nurd8j",
+ "updated": "20230928114931"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "請勿在書籤或標籤中使用特殊符號,否則會導致無法在書籤或標籤面板中重新命名。 這裡的「特殊符號」包括:"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "*"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "_"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "["
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "]"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "!"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "\\"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "`"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "\u0026lt;"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "\u0026gt;"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "\u0026amp;"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "~ "
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "$"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "("
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": ")"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "{"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "}"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "="
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​ 和"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "code",
+ "TextMarkTextContent": "#"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "​。"
}
]
}
diff --git a/kernel/treenode/marker.go b/kernel/treenode/marker.go
index 727f697025..51196e5ac4 100644
--- a/kernel/treenode/marker.go
+++ b/kernel/treenode/marker.go
@@ -36,8 +36,10 @@ func ContainsMarker(str string) (ret string) {
func IsMarker(token byte) bool {
switch token {
- case lex.ItemAsterisk, lex.ItemUnderscore, lex.ItemOpenBracket, lex.ItemBang, lex.ItemNewline, lex.ItemBackslash, lex.ItemBacktick, lex.ItemLess,
- lex.ItemCloseBracket, lex.ItemAmpersand, lex.ItemTilde, lex.ItemDollar, lex.ItemOpenBrace, lex.ItemOpenParen, lex.ItemEqual, lex.ItemCrosshatch:
+ case lex.ItemAsterisk, lex.ItemUnderscore, lex.ItemOpenBracket, lex.ItemCloseBracket, lex.ItemNewline,
+ lex.ItemBang, lex.ItemBackslash, lex.ItemBacktick, lex.ItemLess, lex.ItemGreater,
+ lex.ItemAmpersand, lex.ItemTilde, lex.ItemDollar, lex.ItemOpenBrace, lex.ItemCloseBrace,
+ lex.ItemOpenParen, lex.ItemCloseParen, lex.ItemEqual, lex.ItemCrosshatch:
return true
case lex.ItemCaret:
return true