marked.js 893 B

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