marked.js 803 B

123456789101112131415161718192021222324252627282930
  1. var md = {compilers: {}}
  2. md.compilers.marked = (() => {
  3. var defaults = {
  4. breaks: false,
  5. gfm: true,
  6. pedantic: false,
  7. sanitize: false,
  8. smartypants: false,
  9. langPrefix: 'language-' // prism
  10. }
  11. var description = {
  12. breaks: 'Enable GFM line breaks\n(requires the gfm option to be true)',
  13. gfm: 'Enable GFM\n(GitHub Flavored Markdown)',
  14. pedantic: 'Don\'t fix any of the original markdown\nbugs or poor behavior',
  15. sanitize: 'Ignore any HTML\nthat has been input',
  16. smartypants: 'Use "smart" typographic punctuation\nfor things like quotes and dashes'
  17. }
  18. var ctor = ({storage: {state}}) => ({
  19. defaults,
  20. description,
  21. compile: (markdown) =>
  22. marked.parse(markdown, state.marked)
  23. })
  24. return Object.assign(ctor, {defaults, description})
  25. })()