logseq / logseq

A privacy-first, open-source platform for knowledge management and collaboration. Download link: http://github.com/logseq/logseq/releases. roadmap: http://trello.com/b/8txSM12G/roadmap
https://logseq.com
GNU Affero General Public License v3.0
30.7k stars 1.78k forks source link

Importing from Roam has issues with illegal filenames #2941

Open marcusround opened 2 years ago

marcusround commented 2 years ago

Describe the bug Upon importing my (fairly large) Roam graph I got a bunch of errors that all look like the attached screenshots.

I was able to determine that it is whenever a page's title has a character in it that is not allowed in a filename. It is common for me to have either " or ? in a page title, but these are not allowed in Windows filenames. The pages DO show up in LogSeq with all thier content, but there is NO markdown file created. So the issue is 1) A scary, confusing error 2) No markdown file created

Due to no markdown file being created, the same error pops up any time you try to modify the imported page within Logseq. (It does save the changes in Logseq, but you get loads of errors that you have to click away)

To Reproduce Steps to reproduce the behavior:

  1. Create a page in Roam with " or ? in the page title.
  2. Export from Roam as JSON
  3. Import that JSON into Logseq

Expected behavior I would expect Logseq to (silently?) sanitise the filenames and create a markdown file on disk.

Screenshots If applicable, add screenshots to help explain your problem. Logseq_2pqbz3bnrz Logseq_h9iZsJpdm0

Desktop (please complete the following information):

tiensonqin commented 2 years ago

@marcusround Thank you for the reporting! A fix will be included in the next release.

tiensonqin commented 2 years ago

@marcusround This should be fixed by 0.4.3. https://github.com/logseq/logseq/releases/tag/0.4.3

marcusround commented 2 years ago

Yes, that fixed most of the problem, thank you, that was quick! There was only one page that still presented an issue -- somehow, by accident, one of my Roam pages had a newline character in the page title. In a roam block it looked like this

Here is some text and [[Here is 
the page title]] and here is some more text

And this created a page in Roam called [[Here is the page title]] but which errored when importing into logseq. This is definitely an accident/bug in Roam but nevertheless it seems your file name sanitiser doesn't catch newline.