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

Handle empty markdown (or without title) #1

Open
aardvarksaurus opened this issue Aug 24, 2020 · 0 comments
Open

Handle empty markdown (or without title) #1

aardvarksaurus opened this issue Aug 24, 2020 · 0 comments

Comments

@aardvarksaurus
Copy link

If you let empty the Markdown text field, or if you fill it so the conversion to html does not give any child node (prez.js, line 31; you can do this with just some spaces for example), you won't get any "prez" (😉) and you'll have in your console the following error:

TypeError: Cannot read property 'type' of undefined
    at _updatePrez (wanaprez.dist.js:44900)
    at _doPrez (wanaprez.dist.js:45002)
    at _fulfilled (wanaprez.dist.js:39090)
    at wanaprez.dist.js:39119
    at Promise.promise.promiseDispatch (wanaprez.dist.js:39052)
    at wanaprez.dist.js:38860
    at runSingle (wanaprez.dist.js:38373)
    at flush (wanaprez.dist.js:38361)
    at MessagePort.channel.port1.onmessage (wanaprez.dist.js:38455)

It could be better if you have something like a warning message beforehand (instead of an empty white screen due to the error).

Maybe you can pre-analyze the text to see if it contains at least one valid title?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant