-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Error without stacktrace when parsing long, complex document inside a Html comment tag #49
Comments
Cool. Glad that the library I wrote becomes the building block of you library. I have been working on the other project recently and share little time on nim-markdown. I'll definitely take a look on the issue this weekend! |
Yes, I guess those issues are probably related. Below some more remarks on my side, in case they are helpful. I also did a test using WSL (the test above was on Windows) and I also had to raise iteration to 121 before failing. I was also able to see the segmentation fault error reported (on windows I did not see it). Looking at this forum discussion, I was thinking maybe this is due to a stack overflow (most stuff is ref object so maybe the issue is too many calls to proc?). I did try to modify the stack size and test if iteration limit varies but I was not successful in this attempt:
Specific to this issue and related to performance (but really restricted only to specific case of Html Comments), looking at the source I notice the fact that an HTML comment could probably be dealt in a different way than other Markdown Blocks ( |
I ran into a weird behaviour that I was able to minimize in the following example:
Running this (nim 1.4.0, markdown #head) the program errors out without a stack trace.
If I reduce the number of iterations, or remove any line or element from
text
the error disappears.The behaviour seems to be related to the appearance of a long and fairly complex (from parsing perspective) text inside a Html coment tag (it is sufficient that it starts with
<!--
).Apart from this, I have to say this library is excellent, I have been using it extensively and it is the first time that it fails me (not too harmful, the workaround is simple: just split the text; it was only a bit tricky to minimize the error).
I take the opportunity to thank you for the work you did with nim-markdown and also nim-mustache, which are core dependencies of something I am working on and I am about to release (hopefully) soon: https://github.com/pietroppeter/nimib
The text was updated successfully, but these errors were encountered: