remarkable.js 792 B

12345678910111213141516171819202122232425262728293031
  1. md.compilers.remarkable = (() => {
  2. var defaults = {
  3. breaks: true,
  4. html: true,
  5. linkify: true,
  6. typographer: false,
  7. xhtmlOut: false,
  8. langPrefix: 'language-',
  9. quotes: '“”‘’'
  10. // highlight: (str, lang) => ''
  11. }
  12. var description = {
  13. breaks: 'Convert \\n in paragraphs into <br>',
  14. html: 'Enable HTML tags in source',
  15. linkify: 'Autoconvert URL-like text to links',
  16. typographer: 'Enable some language-neutral replacement + quotes beautification',
  17. xhtmlOut: 'Use / to close single tags (<br />)'
  18. }
  19. var ctor = ({storage: {state}}) => ({
  20. defaults,
  21. description,
  22. compile: (markdown) =>
  23. new Remarkable('full', state.remarkable)
  24. .render(markdown)
  25. })
  26. return Object.assign(ctor, {defaults, description})
  27. })()