|
@@ -6,16 +6,17 @@ md.compilers.marked = (() => {
|
|
|
breaks: false,
|
|
|
gfm: true,
|
|
|
pedantic: false,
|
|
|
- sanitize: false,
|
|
|
+ // plugins
|
|
|
+ linkify: true,
|
|
|
smartypants: false,
|
|
|
- langPrefix: 'language-' // prism
|
|
|
}
|
|
|
|
|
|
var description = {
|
|
|
breaks: 'Enable GFM line breaks\n(requires the gfm option to be true)',
|
|
|
gfm: 'Enable GFM\n(GitHub Flavored Markdown)',
|
|
|
pedantic: 'Don\'t fix any of the original markdown\nbugs or poor behavior',
|
|
|
- sanitize: 'Ignore any HTML\nthat has been input',
|
|
|
+ // plugins
|
|
|
+ linkify: 'Autoconvert URL-like text to links',
|
|
|
smartypants: 'Use "smart" typographic punctuation\nfor things like quotes and dashes'
|
|
|
}
|
|
|
|
|
@@ -23,7 +24,12 @@ md.compilers.marked = (() => {
|
|
|
defaults,
|
|
|
description,
|
|
|
compile: (markdown) =>
|
|
|
- marked.parse(markdown, state.marked)
|
|
|
+ new marked.marked(
|
|
|
+ state.marked,
|
|
|
+ marked.headings(),
|
|
|
+ state.marked.linkify ? marked.linkify() : () => {},
|
|
|
+ state.marked.smartypants ? marked.smartypants() : () => {},
|
|
|
+ ).parse(markdown)
|
|
|
})
|
|
|
|
|
|
return Object.assign(ctor, {defaults, description})
|