Secure markdown renderer working on browsers for user input data.
TypeScript HTML JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

Securemark

Build Status Coverage Status Dependency Status

Secure markdown renderer working on browsers for user input data.

Features

  • Secure DOM rendering.
  • Declarative syntax.
  • Recursive parsing.
  • Incremental update.
  • Progressive rendering.
  • Unblinking rendering.
  • Large document support.
  • Syntax highlight with PrismJS.
  • LaTeX rendering with MathJax.
  • Figure, Annotation, and Authority syntax.
  • Index generation for headings, terms, and figures.
  • Shortlink syntax for local references of indexes and figures.
  • Auto numbering of figures and footnotes.
  • Footnote and its bidirectional reference link generation from annotations and authorities.
  • Table of contents.

Demos

https://falsandtru.github.io/securemark/

APIs

index.d.ts

Syntax

markdown.d.ts

  • Heading (#)
  • UList (-)
  • OList (1.)
  • DList (~)
  • Table (| |)
  • Blockquote (>, !>)
  • Preformattedtext (```)
  • HorizontalRule (---)
  • Inline markups (*, ~~, `, [](), ![](), (()), ...)
  • Inline HTML tags (<smal>, <ruby>, <code>, ...)
  • Autolink (https://host, ttps://host, !https://host/image.png, @account)
  • Media (!https://host/image.png, !https://youtu.be/..., !https://gist.github.com/...)
  • Syntex highlight (```lang filename)
  • LaTeX ($expr$, $$expr$$)
  • Figure (~~~figure [:fig-name])
  • Label ([:fig-name])
  • Annotation (((annotation)))
  • Authority ([[authority]])
  • Index (# title [#section], ~ term [#term], [#some words])
  • Channel (@account#tag)
  • Hashtag (#tag)
  • Comment (<# comment #>, <!-- comment -->)

Media

  • Twitter
  • YouTube
  • Gist
  • SlideShare
  • PDF (.pdf)
  • Video (.webm, .ogv)
  • Audio (.oga, .ogg)
  • Images

Dependencies

  • PrismJS
  • MathJax
  • jQuery (for Ajax)
  • DOMPurify

Browsers

Requires es6 and modern DOM API support.

  • Chrome
  • Firefox
  • Edge
  • Safari

Polyfill: https://cdn.polyfill.io