Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating page name doesn't update tags prefixed with special char #6611

Open
Amoscey opened this issue Sep 6, 2022 · 5 comments
Open

updating page name doesn't update tags prefixed with special char #6611

Amoscey opened this issue Sep 6, 2022 · 5 comments
Labels
page-ref page reference page-rename parser Markdown/Org parser related :type/bug Something isn't working. Affects daily use.

Comments

@Amoscey
Copy link

Amoscey commented Sep 6, 2022

What happened?

笔记名字修改后对应的其他笔记提到的原名字不会一起更改
比如有一个名为“Note1”的笔记,但是我改成了“note01”,这个时候,其他笔记上只有对应的 “[[Note1]]” 会改成 “[[note01]]” ,但是 "#Note1" 就不会改成"#note01"

For example, there is a note named "Note1", but I changed it to "note01".
At this time, only the "[[Note1]]" in other notes will be changed to "[[note01]]", but "#Note1" will not be changed to "#note01"

Reproduce the Bug

Windows system

Expected Behavior

No response

Screenshots

No response

Desktop Platform Information

No response

Mobile Platform Information

No response

Additional Context

No response

@cnrpman
Copy link
Collaborator

cnrpman commented Sep 6, 2022

It's an issue related to CJK character compatiblity in code. Actually the case you provide won't trigger the issue. It only happens on non-latin characters.

Fixed in 0.8.3 Already.

0.83已经修复。请更新最新版。

@cnrpman cnrpman added awaiting-response Issue will be closed if a reply is not received fixed-next-release ✅ Fixed, will be in the next release and removed fixed-next-release ✅ Fixed, will be in the next release labels Sep 6, 2022
@Amoscey
Copy link
Author

Amoscey commented Sep 6, 2022

It's an issue related to CJK character compatiblity in code. Actually the case you provide won't trigger the issue. It only happens on non-latin characters.

Fixed in 0.8.3 Already.

0.83已经修复。请更新最新版。

我更新后测试了一下,其他情况下可以,不过又发现一个新情况,如果前面带等于号就不行了。

image

image

@cnrpman
Copy link
Collaborator

cnrpman commented Sep 6, 2022

@Amoscey Thank you for your great dig-in!
The = in =#Hashtag Sounds like a magic character to me. I tested some other symbols and all of them can't trigger Hashtag link. I don't know if it belongs to the design and need some time to investigate the mldoc code.

@cnrpman cnrpman added parser Markdown/Org parser related page-ref page reference and removed awaiting-response Issue will be closed if a reply is not received fixed-next-release ✅ Fixed, will be in the next release labels Sep 6, 2022
@Bad3r
Copy link
Collaborator

Bad3r commented Mar 6, 2023

This issue exists in 0.8.18

Steps to reproduce:
1. on a block add the following line [[tag0]] #tag0 -#tag0 =#tag0 !#tag0

2. navigate to [[tag0] and rename it to [[tag1]]
3. notice the results:

only [[tag]] and #tag were updated.

@Bad3r Bad3r added :type/bug Something isn't working. Affects daily use. and removed :status/automatic-stale labels Mar 6, 2023
@Bad3r Bad3r changed the title After the note name is modified, the original names mentioned in the corresponding other notes will not be changed together updating page name doesn't update tags prefixed with special char Mar 6, 2023
@logseq logseq deleted a comment from github-actions bot Mar 6, 2023
@cnrpman
Copy link
Collaborator

cnrpman commented Jun 4, 2023

The entry in codebase of this part:

(defn- replace-tag-ref!
[content old-name new-name]
(let [old-tag (util/format "#%s" old-name)
new-tag (if (re-find #"[\s\t]+" new-name)
(util/format "#[[%s]]" new-name)
(str "#" new-name))]
;; hash tag parsing rules https://github.com/logseq/mldoc/blob/701243eaf9b4157348f235670718f6ad19ebe7f8/test/test_markdown.ml#L631
;; Safari doesn't support look behind, don't use
;; TODO: parse via mldoc
(string/replace content
(re-pattern (str "(?i)(^|\\s)(" (util/escape-regex-chars old-tag) ")(?=[,\\.]*($|\\s))"))
;; case_insense^ ^lhs ^_grp2 look_ahead^ ^_grp3
(fn [[_match lhs _grp2 _grp3]]
(str lhs new-tag)))))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
page-ref page reference page-rename parser Markdown/Org parser related :type/bug Something isn't working. Affects daily use.
Projects
Status: 🗄 Backlog
Development

No branches or pull requests

4 participants