Parsing the Markdown

This document details how Wysimark guarantees adherence to the Markdown specification and how it affects apps with existing Markdown

Wysimark adheres to the GitHub Flavored Markdown specification.

It can be parsed and displayed by all popular Markdown libraries including marked, markdown-it, remarkable and remark.

GFM is extremely popular because it includes tables, task lists and strikethroughs which themselves are highly desired features.

Note: For most people, this is all that is necessary to use Wysimark's Markdown support. The rest of the document deep dives through the Markdown specification and shows how Wysimark makes it safe and consistent for a better user experience if you have existing content in Markdown.

Guaranteed Valid Markdown Generation

Wysimark guarantees that any document generated by the Wysimark editor will return a round-trippable valid GFM Markdown document that adheres to the GitHub Flavored Markdown Specification.

By round-trippable, we mean that when you save the document then read it again, it comes back looking the same and retains 100% of its content and formatting. If the document is loaded into Wysimark and saved again, it generates exactly the same markdown text. That is, it can survive a round-trip to the server.

All documents created by Wysimark are guaranteed to follow the GFM specification which means any markdown parser that supports GFM can parse the document and display it correctly.

Markdown Interpretation For Safety and a Better User Experience

If you have existing Markdown documents in your app, Wysimark interprets those documents using the markdown specification and adheres as closely to the Markdown specification as possible while preventing code injection attacks and preventing badly formatted documents.

Convert HTML to Inline Code or Code Blocks

Markdown allows HTML code into a document; however, few parsers allow HTML code by default because it is a huge security risk. In order to not destroy content, we convert any embedded HTML into inline code and code blocks instead.

This should not affect you were allowing and depending on unsafe code being present in Markdown.

Convert Inline Images to Block Images

Markdown allows multiple images to be displayed in a single line and even allows images to be displayed inline next to text.

Fix Mixed Content Lists

st people, you do not need to think or care about the edge cases

Every Markdown parser and editor must make certain decisions for security and user experience reasons. Wysimark has taken a long hard look at the edges of the Markdown specification to make sure you get an editor with the best trade offs. This will also save you time from having to make these hard decisions

Last updated

Was this helpful?