Markdown parser, done right. 100% CommonMark support, extensions, syntax plugins & high speed
https://markdown-it.github.io/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
1.9 KiB
79 lines
1.9 KiB
10 years ago
|
// Commonmark default options
|
||
|
|
||
1 year ago
|
export default {
|
||
10 years ago
|
options: {
|
||
10 years ago
|
html: true, // Enable HTML tags in source
|
||
10 years ago
|
xhtmlOut: true, // Use '/' to close single tags (<br />)
|
||
|
breaks: false, // Convert '\n' in paragraphs into <br>
|
||
|
langPrefix: 'language-', // CSS language prefix for fenced blocks
|
||
10 years ago
|
linkify: false, // autoconvert URL-like texts to links
|
||
10 years ago
|
|
||
10 years ago
|
// Enable some language-neutral replacements + quotes beautification
|
||
10 years ago
|
typographer: false,
|
||
|
|
||
|
// Double + single quotes replacement pairs, when typographer enabled,
|
||
10 years ago
|
// and smartquotes on. Could be either a String or an Array.
|
||
|
//
|
||
|
// For example, you can use '«»„“' for Russian, '„“‚‘' for German,
|
||
|
// and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
|
||
10 years ago
|
quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
|
||
10 years ago
|
|
||
10 years ago
|
// Highlighter function. Should return escaped HTML,
|
||
9 years ago
|
// or '' if the source string is not changed and should be escaped externaly.
|
||
|
// If result starts with <pre... internal wrapper is skipped.
|
||
10 years ago
|
//
|
||
|
// function (/*str, lang*/) { return ''; }
|
||
|
//
|
||
|
highlight: null,
|
||
10 years ago
|
|
||
|
maxNesting: 20 // Internal protection, recursion limit
|
||
|
},
|
||
|
|
||
|
components: {
|
||
|
|
||
10 years ago
|
core: {
|
||
|
rules: [
|
||
10 years ago
|
'normalize',
|
||
10 years ago
|
'block',
|
||
3 years ago
|
'inline',
|
||
|
'text_join'
|
||
10 years ago
|
]
|
||
|
},
|
||
10 years ago
|
|
||
10 years ago
|
block: {
|
||
|
rules: [
|
||
|
'blockquote',
|
||
|
'code',
|
||
10 years ago
|
'fence',
|
||
10 years ago
|
'heading',
|
||
|
'hr',
|
||
10 years ago
|
'html_block',
|
||
10 years ago
|
'lheading',
|
||
|
'list',
|
||
10 years ago
|
'reference',
|
||
10 years ago
|
'paragraph'
|
||
|
]
|
||
|
},
|
||
|
|
||
|
inline: {
|
||
|
rules: [
|
||
|
'autolink',
|
||
10 years ago
|
'backticks',
|
||
10 years ago
|
'emphasis',
|
||
|
'entity',
|
||
|
'escape',
|
||
10 years ago
|
'html_inline',
|
||
10 years ago
|
'image',
|
||
|
'link',
|
||
10 years ago
|
'newline',
|
||
|
'text'
|
||
9 years ago
|
],
|
||
|
rules2: [
|
||
|
'balance_pairs',
|
||
|
'emphasis',
|
||
3 years ago
|
'fragments_join'
|
||
10 years ago
|
]
|
||
|
}
|
||
|
}
|
||
|
};
|