commonmark.mjs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // Commonmark default options
  2. export default {
  3. options: {
  4. // Enable HTML tags in source
  5. html: true,
  6. // Use '/' to close single tags (<br />)
  7. xhtmlOut: true,
  8. // Convert '\n' in paragraphs into <br>
  9. breaks: false,
  10. // CSS language prefix for fenced blocks
  11. langPrefix: 'language-',
  12. // autoconvert URL-like texts to links
  13. linkify: false,
  14. // Enable some language-neutral replacements + quotes beautification
  15. typographer: false,
  16. // Double + single quotes replacement pairs, when typographer enabled,
  17. // and smartquotes on. Could be either a String or an Array.
  18. //
  19. // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
  20. // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
  21. quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
  22. // Highlighter function. Should return escaped HTML,
  23. // or '' if the source string is not changed and should be escaped externaly.
  24. // If result starts with <pre... internal wrapper is skipped.
  25. //
  26. // function (/*str, lang*/) { return ''; }
  27. //
  28. highlight: null,
  29. // Internal protection, recursion limit
  30. maxNesting: 20
  31. },
  32. components: {
  33. core: {
  34. rules: [
  35. 'normalize',
  36. 'block',
  37. 'inline',
  38. 'text_join'
  39. ]
  40. },
  41. block: {
  42. rules: [
  43. 'blockquote',
  44. 'code',
  45. 'fence',
  46. 'heading',
  47. 'hr',
  48. 'html_block',
  49. 'lheading',
  50. 'list',
  51. 'reference',
  52. 'paragraph'
  53. ]
  54. },
  55. inline: {
  56. rules: [
  57. 'autolink',
  58. 'backticks',
  59. 'emphasis',
  60. 'entity',
  61. 'escape',
  62. 'html_inline',
  63. 'image',
  64. 'link',
  65. 'newline',
  66. 'text'
  67. ],
  68. rules2: [
  69. 'balance_pairs',
  70. 'emphasis',
  71. 'fragments_join'
  72. ]
  73. }
  74. }
  75. }