Open WillNilges opened 11 months ago
Hi @WillNilges,
First of all, thanks for sharing :) it is unmaintained but issues like this are welcome.
I tried importing an empty file created with touch empty.md
but couldn't reproduce the issue. Indeed, there's already a check for empty files when trying to import a page.
I did manage to reproduce the issue with an almost empty file created with echo "" > empty.md
. In this case, the file actually contains a single linefeed, you can check this with ls -l
. This means that file passes the check and is uploaded to Bookstack, which doesn't seem to like a page with just a linefeed.
So I'm not sure if this requires any action. One option could be to strip white space at the end of each line during parsing, and checking if the concatenated text is not empty before calling the API. I'll think about it before closing the issue, I'm open to suggestions. :)
(I know this project is unmaintained, I'm just putting this here for others)
Importing will fail with the following message if you try to import an empty file:
Perhaps this should include a warning that the page is empty?