commonmark.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. 'text_join'
  34. ]
  35. },
  36. block: {
  37. rules: [
  38. 'blockquote',
  39. 'code',
  40. 'fence',
  41. 'heading',
  42. 'hr',
  43. 'html_block',
  44. 'lheading',
  45. 'list',
  46. 'reference',
  47. 'paragraph'
  48. ]
  49. },
  50. inline: {
  51. rules: [
  52. 'autolink',
  53. 'backticks',
  54. 'emphasis',
  55. 'entity',
  56. 'escape',
  57. 'html_inline',
  58. 'image',
  59. 'link',
  60. 'newline',
  61. 'text'
  62. ],
  63. rules2: [
  64. 'balance_pairs',
  65. 'emphasis',
  66. 'fragments_join'
  67. ]
  68. }
  69. }
  70. };