Skip to content

Any way to make library safer? #19

@MichaelXavier

Description

@MichaelXavier

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.

  1. 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?
  2. I don't know much about the markdown standard but is there a way to make invalid nodes inexpressable in the types?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions