commonmark.js 1.9 KB

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