Exposes the base API for the showdown and marked modules, written in Rust for WebAssembly.
This module is not supposed to be used directly as a dependence by an application, it is used as a backend for js connector
var showdown = require('dessert-markdown-core'),
converter = new showdown.Converter(),
text = '# hello, markdown!',
html = converter.makeHtml(text);
Converts Markdown to HTML
Returns the value of the given option key
Sets the value of the given option key
Returns all the options and their values
-
noHeaderId: (boolean) [default false] Disable the automatic generation of header ids. Setting to true overrides prefixHeaderId
-
customizedHeaderId: (boolean) [default false] Use text in curly braces as header id.
-
ghCompatibleHeaderId: (boolean) [default false] Generate header ids compatible with github style (spaces are replaced with dashes and a bunch of non alphanumeric chars are removed)
-
prefixHeaderId: (string/boolean) [default false] Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to
true
will add a generic 'section' prefix. -
rawPrefixHeaderId: (boolean) [default false] Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix). Has no effect if prefixHeaderId is set to false.
-
rawHeaderId: (boolean) [default false] Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids.
-
headerLevelStart: (integer) [default 1] Set the header starting level.
-
strikethrough: (boolean) [default false] Enable support for strikethrough syntax.
-
tables: (boolean) [default false] Enable support for tables syntax.
-
tasklists: (boolean) [default false] Enable support for GFM tasklists.
-
simpleLineBreaks: (boolean) [default false] Parses line breaks as
<br>
, without needing 2 spaces at the end of the line. -
requireSpaceBeforeHeadingText: (boolean) [default false] Makes adding a space between
#
and the header text mandatory. -
ghMentions: (boolean) [default false] Enables github @mentions, which link to the username mentioned.
-
ghMentionsLink: (string) [default
https://github.com/{u}
] Changes the link generated by @mentions. -
openLinksInNewWindow: (boolean) [default false] Open all links in new windows
-
emoji: (boolean) [default false] Enable emoji support. Ex:
this is a :smile: emoji
dessert-markdown-core is depended on by dessert-showdown
npm install dessert-markdown-core
The project is built using wasm-pack
To build the project, run
wasm-pack build
wasm-pack test --headless --firefox # or --chrome
MIT
See CONTRIBUTING.md