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

Severe issues occur when title is tailed with a space! #4693

Open
Konfido opened this issue Mar 23, 2022 · 5 comments · May be fixed by logseq/mldoc#122
Open

Severe issues occur when title is tailed with a space! #4693

Konfido opened this issue Mar 23, 2022 · 5 comments · May be fixed by logseq/mldoc#122
Labels
parser Markdown/Org parser related :type/enhancement Enhancement to product. Does not affect the overall basic use.

Comments

@Konfido
Copy link

Konfido commented Mar 23, 2022

What happened?

When the value of property "title" in yaml front matter is tailed with a space, some several issues will occur:

  • The source file can be viewed in external app, but the page content gets empty when it's opened in logseq.
  • It will generate two separate pages when you try to open/click the backlink without a tailing space, and neither of them has valid content.
  • Before I knew what's caused this problem, I've tried to reindex the whole graph, and it just delete the actual content.

Reproduce the Bug

  1. Just open a markdown source file, and tail a space to the "title" property on its yaml front matter.
  2. Then try to search/open it in logseq, but bug will be reproduced.

Expected Behavior

Just ignore the tailed space in the title or trim it automatically, but not delete the whole content.

Screenshots

No response

Desktop Platform Information

  • MacOS 10.15.7
  • logseq 0.6.4

Mobile Platform Information

No response

Additional Context

No response

@cnrpman
Copy link
Collaborator

cnrpman commented Mar 23, 2022

I can't tail the title property with space:
https://www.loom.com/share/f5b0cb80a4e14c84a3935344c27230ce

@cnrpman cnrpman added the need-to-reproduce More clues are required to reproduce the issue. label Mar 23, 2022
@Konfido
Copy link
Author

Konfido commented Mar 23, 2022

I can't tail the title property with space: loom.com/share/f5b0cb80a4e14c84a3935344c27230ce

Yeah, I find it too. You may try to edit it in an external app.
When you just create/edit pages inside logseq, it's not a problem.
But normally I also use Typora/Obsidian/VScode to work with logseq, and these apps will not trim the tailing space after editing is done.

@cnrpman
Copy link
Collaborator

cnrpman commented Mar 23, 2022

@Konfido Yes, it's a severe issue if it's editing from outside. Should have a sanity check here.

@cnrpman cnrpman removed the need-to-reproduce More clues are required to reproduce the issue. label Mar 23, 2022
@cnrpman
Copy link
Collaborator

cnrpman commented Mar 23, 2022

@Konfido Sorry for bothering again. I tried and I think the tailing spaces in file parsing are handled:
https://www.loom.com/share/041d6987c8c6426dab3cd697c87e0313
Do you have the detailed step to reproduce your case?

@Konfido
Copy link
Author

Konfido commented Mar 23, 2022

@Konfido Sorry for bothering again. I tried and I think the tailing spaces in file parsing are handled: loom.com/share/041d6987c8c6426dab3cd697c87e0313 Do you have the detailed step to reproduce your case?

I think I found the reason: this issue only happens in the page with YAML-formatted front matter (quoted by ---).

test

@cnrpman cnrpman added parser Markdown/Org parser related :type/enhancement Enhancement to product. Does not affect the overall basic use. and removed priority-A data-stability page-ref page reference filenames labels Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parser Markdown/Org parser related :type/enhancement Enhancement to product. Does not affect the overall basic use.
Projects
Status: 🗄 Backlog
Development

Successfully merging a pull request may close this issue.

2 participants