I was trying to write a test generator that generated some random markdown. I decided to start with the Node type since it seemed easier than generating valid markdown text first and parsing it. I found that if you construct an apparently invalid markdown: Node Nothing PARAGRAPH [Node Nothing DOCUMENT mempty], running nodeToHtml against it results in a SIGSEGV and crashes the entire program.
- Is there any possible way this can be reified into the library so that any rendering function that could segfault could instead return an
Either?
- I don't know much about the markdown standard but is there a way to make invalid nodes inexpressable in the types?
I was trying to write a test generator that generated some random markdown. I decided to start with the
Nodetype since it seemed easier than generating valid markdown text first and parsing it. I found that if you construct an apparently invalid markdown:Node Nothing PARAGRAPH [Node Nothing DOCUMENT mempty], runningnodeToHtmlagainst it results in aSIGSEGVand crashes the entire program.Either?