Skip to content

How to use for Markdown validation? #652

Answered by colinodell
meglio asked this question in Q&A
Discussion options

You must be logged in to vote

According to section 2.1 of the CommonMark spec any plain-text file is valid:

Any sequence of characters is a valid CommonMark document.

A character is a Unicode code point. Although some code points (for example, combining accents) do not correspond to characters in an intuitive sense, all code points count as characters for purposes of this spec.

This spec does not specify an encoding; it thinks of lines as composed of characters rather than bytes. A conforming parser may be limited to a certain encoding.

We don't perform this validation in our library, but you could use something like this to check the MIME type and return TRUE for plain-text documents.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by colinodell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question General questions about the project or usage
2 participants
Converted from issue

This discussion was converted from issue #332 on June 12, 2021 14:04.