@alexlit/lint-kit 107.0.0 → 107.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/package.json +1 -11
  2. package/packages/config-commitlint/package.json +2 -2
  3. package/packages/config-eslint/package.json +4 -4
  4. package/packages/config-hooks/package.json +3 -3
  5. package/packages/config-markdownlint/node_modules/markdown-it/LICENSE +22 -0
  6. package/packages/config-markdownlint/node_modules/markdown-it/README.md +309 -0
  7. package/packages/config-markdownlint/node_modules/markdown-it/bin/markdown-it.js +117 -0
  8. package/packages/config-markdownlint/node_modules/markdown-it/dist/markdown-it.js +8441 -0
  9. package/packages/config-markdownlint/node_modules/markdown-it/dist/markdown-it.min.js +3 -0
  10. package/packages/config-markdownlint/node_modules/markdown-it/index.js +4 -0
  11. package/packages/config-markdownlint/node_modules/markdown-it/lib/common/entities.js +6 -0
  12. package/packages/config-markdownlint/node_modules/markdown-it/lib/common/html_blocks.js +70 -0
  13. package/packages/config-markdownlint/node_modules/markdown-it/lib/common/html_re.js +28 -0
  14. package/packages/config-markdownlint/node_modules/markdown-it/lib/common/utils.js +317 -0
  15. package/packages/config-markdownlint/node_modules/markdown-it/lib/helpers/index.js +7 -0
  16. package/packages/config-markdownlint/node_modules/markdown-it/lib/helpers/parse_link_destination.js +80 -0
  17. package/packages/config-markdownlint/node_modules/markdown-it/lib/helpers/parse_link_label.js +48 -0
  18. package/packages/config-markdownlint/node_modules/markdown-it/lib/helpers/parse_link_title.js +55 -0
  19. package/packages/config-markdownlint/node_modules/markdown-it/lib/index.js +582 -0
  20. package/packages/config-markdownlint/node_modules/markdown-it/lib/parser_block.js +131 -0
  21. package/packages/config-markdownlint/node_modules/markdown-it/lib/parser_core.js +61 -0
  22. package/packages/config-markdownlint/node_modules/markdown-it/lib/parser_inline.js +192 -0
  23. package/packages/config-markdownlint/node_modules/markdown-it/lib/presets/commonmark.js +81 -0
  24. package/packages/config-markdownlint/node_modules/markdown-it/lib/presets/default.js +41 -0
  25. package/packages/config-markdownlint/node_modules/markdown-it/lib/presets/zero.js +63 -0
  26. package/packages/config-markdownlint/node_modules/markdown-it/lib/renderer.js +341 -0
  27. package/packages/config-markdownlint/node_modules/markdown-it/lib/ruler.js +352 -0
  28. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/blockquote.js +226 -0
  29. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/code.js +34 -0
  30. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/fence.js +98 -0
  31. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/heading.js +55 -0
  32. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/hr.js +45 -0
  33. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/html_block.js +74 -0
  34. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/lheading.js +83 -0
  35. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/list.js +362 -0
  36. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/paragraph.js +51 -0
  37. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/reference.js +198 -0
  38. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/state_block.js +231 -0
  39. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/table.js +221 -0
  40. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/block.js +16 -0
  41. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/inline.js +13 -0
  42. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/linkify.js +142 -0
  43. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/normalize.js +21 -0
  44. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/replacements.js +105 -0
  45. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/smartquotes.js +201 -0
  46. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/state_core.js +20 -0
  47. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/text_join.js +45 -0
  48. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/autolink.js +76 -0
  49. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/backticks.js +63 -0
  50. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/balance_pairs.js +130 -0
  51. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/emphasis.js +130 -0
  52. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/entity.js +55 -0
  53. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/escape.js +71 -0
  54. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/fragments_join.js +41 -0
  55. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/html_inline.js +58 -0
  56. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/image.js +152 -0
  57. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/link.js +150 -0
  58. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/linkify.js +62 -0
  59. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/newline.js +46 -0
  60. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/state_inline.js +158 -0
  61. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/strikethrough.js +130 -0
  62. package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/text.js +89 -0
  63. package/packages/config-markdownlint/node_modules/markdown-it/lib/token.js +201 -0
  64. package/packages/config-markdownlint/node_modules/markdown-it/package.json +87 -0
  65. package/packages/config-markdownlint/node_modules/markdownlint/CHANGELOG.md +428 -0
  66. package/packages/config-markdownlint/node_modules/markdownlint/CONTRIBUTING.md +92 -0
  67. package/packages/config-markdownlint/node_modules/markdownlint/LICENSE +21 -0
  68. package/packages/config-markdownlint/node_modules/markdownlint/README.md +1026 -0
  69. package/packages/config-markdownlint/node_modules/markdownlint/demo/markdownlint-browser.js +6814 -0
  70. package/packages/config-markdownlint/node_modules/markdownlint/doc/CustomRules.md +376 -0
  71. package/packages/config-markdownlint/node_modules/markdownlint/doc/Prettier.md +27 -0
  72. package/packages/config-markdownlint/node_modules/markdownlint/doc/ReleaseProcess.md +20 -0
  73. package/packages/config-markdownlint/node_modules/markdownlint/doc/Rules.md +2335 -0
  74. package/packages/config-markdownlint/node_modules/markdownlint/doc/md001.md +37 -0
  75. package/packages/config-markdownlint/node_modules/markdownlint/doc/md003.md +59 -0
  76. package/packages/config-markdownlint/node_modules/markdownlint/doc/md004.md +49 -0
  77. package/packages/config-markdownlint/node_modules/markdownlint/doc/md005.md +53 -0
  78. package/packages/config-markdownlint/node_modules/markdownlint/doc/md007.md +52 -0
  79. package/packages/config-markdownlint/node_modules/markdownlint/doc/md009.md +51 -0
  80. package/packages/config-markdownlint/node_modules/markdownlint/doc/md010.md +56 -0
  81. package/packages/config-markdownlint/node_modules/markdownlint/doc/md011.md +30 -0
  82. package/packages/config-markdownlint/node_modules/markdownlint/doc/md012.md +38 -0
  83. package/packages/config-markdownlint/node_modules/markdownlint/doc/md013.md +57 -0
  84. package/packages/config-markdownlint/node_modules/markdownlint/doc/md014.md +54 -0
  85. package/packages/config-markdownlint/node_modules/markdownlint/doc/md018.md +27 -0
  86. package/packages/config-markdownlint/node_modules/markdownlint/doc/md019.md +28 -0
  87. package/packages/config-markdownlint/node_modules/markdownlint/doc/md020.md +29 -0
  88. package/packages/config-markdownlint/node_modules/markdownlint/doc/md021.md +31 -0
  89. package/packages/config-markdownlint/node_modules/markdownlint/doc/md022.md +52 -0
  90. package/packages/config-markdownlint/node_modules/markdownlint/doc/md023.md +33 -0
  91. package/packages/config-markdownlint/node_modules/markdownlint/doc/md024.md +47 -0
  92. package/packages/config-markdownlint/node_modules/markdownlint/doc/md025.md +49 -0
  93. package/packages/config-markdownlint/node_modules/markdownlint/doc/md026.md +40 -0
  94. package/packages/config-markdownlint/node_modules/markdownlint/doc/md027.md +24 -0
  95. package/packages/config-markdownlint/node_modules/markdownlint/doc/md028.md +40 -0
  96. package/packages/config-markdownlint/node_modules/markdownlint/doc/md029.md +98 -0
  97. package/packages/config-markdownlint/node_modules/markdownlint/doc/md030.md +82 -0
  98. package/packages/config-markdownlint/node_modules/markdownlint/doc/md031.md +50 -0
  99. package/packages/config-markdownlint/node_modules/markdownlint/doc/md032.md +55 -0
  100. package/packages/config-markdownlint/node_modules/markdownlint/doc/md033.md +27 -0
  101. package/packages/config-markdownlint/node_modules/markdownlint/doc/md034.md +50 -0
  102. package/packages/config-markdownlint/node_modules/markdownlint/doc/md035.md +42 -0
  103. package/packages/config-markdownlint/node_modules/markdownlint/doc/md036.md +45 -0
  104. package/packages/config-markdownlint/node_modules/markdownlint/doc/md037.md +37 -0
  105. package/packages/config-markdownlint/node_modules/markdownlint/doc/md038.md +40 -0
  106. package/packages/config-markdownlint/node_modules/markdownlint/doc/md039.md +21 -0
  107. package/packages/config-markdownlint/node_modules/markdownlint/doc/md040.md +52 -0
  108. package/packages/config-markdownlint/node_modules/markdownlint/doc/md041.md +49 -0
  109. package/packages/config-markdownlint/node_modules/markdownlint/doc/md042.md +32 -0
  110. package/packages/config-markdownlint/node_modules/markdownlint/doc/md043.md +69 -0
  111. package/packages/config-markdownlint/node_modules/markdownlint/doc/md044.md +35 -0
  112. package/packages/config-markdownlint/node_modules/markdownlint/doc/md045.md +40 -0
  113. package/packages/config-markdownlint/node_modules/markdownlint/doc/md046.md +40 -0
  114. package/packages/config-markdownlint/node_modules/markdownlint/doc/md047.md +34 -0
  115. package/packages/config-markdownlint/node_modules/markdownlint/doc/md048.md +41 -0
  116. package/packages/config-markdownlint/node_modules/markdownlint/doc/md049.md +32 -0
  117. package/packages/config-markdownlint/node_modules/markdownlint/doc/md050.md +32 -0
  118. package/packages/config-markdownlint/node_modules/markdownlint/doc/md051.md +61 -0
  119. package/packages/config-markdownlint/node_modules/markdownlint/doc/md052.md +40 -0
  120. package/packages/config-markdownlint/node_modules/markdownlint/doc/md053.md +38 -0
  121. package/packages/config-markdownlint/node_modules/markdownlint/doc/md054.md +100 -0
  122. package/packages/config-markdownlint/node_modules/markdownlint/helpers/LICENSE +21 -0
  123. package/packages/config-markdownlint/node_modules/markdownlint/helpers/README.md +70 -0
  124. package/packages/config-markdownlint/node_modules/markdownlint/helpers/helpers.js +1025 -0
  125. package/packages/config-markdownlint/node_modules/markdownlint/helpers/micromark.cjs +426 -0
  126. package/packages/config-markdownlint/node_modules/markdownlint/helpers/package.json +26 -0
  127. package/packages/config-markdownlint/node_modules/markdownlint/helpers/shared.js +10 -0
  128. package/packages/config-markdownlint/node_modules/markdownlint/lib/cache.js +21 -0
  129. package/packages/config-markdownlint/node_modules/markdownlint/lib/configuration.d.ts +1152 -0
  130. package/packages/config-markdownlint/node_modules/markdownlint/lib/constants.js +14 -0
  131. package/packages/config-markdownlint/node_modules/markdownlint/lib/markdownlint.d.ts +406 -0
  132. package/packages/config-markdownlint/node_modules/markdownlint/lib/markdownlint.js +1476 -0
  133. package/packages/config-markdownlint/node_modules/markdownlint/lib/md001.js +22 -0
  134. package/packages/config-markdownlint/node_modules/markdownlint/lib/md003.js +42 -0
  135. package/packages/config-markdownlint/node_modules/markdownlint/lib/md004.js +76 -0
  136. package/packages/config-markdownlint/node_modules/markdownlint/lib/md005.js +73 -0
  137. package/packages/config-markdownlint/node_modules/markdownlint/lib/md007.js +86 -0
  138. package/packages/config-markdownlint/node_modules/markdownlint/lib/md009.js +86 -0
  139. package/packages/config-markdownlint/node_modules/markdownlint/lib/md010.js +60 -0
  140. package/packages/config-markdownlint/node_modules/markdownlint/lib/md011.js +46 -0
  141. package/packages/config-markdownlint/node_modules/markdownlint/lib/md012.js +32 -0
  142. package/packages/config-markdownlint/node_modules/markdownlint/lib/md013.js +96 -0
  143. package/packages/config-markdownlint/node_modules/markdownlint/lib/md014.js +53 -0
  144. package/packages/config-markdownlint/node_modules/markdownlint/lib/md018.js +34 -0
  145. package/packages/config-markdownlint/node_modules/markdownlint/lib/md019.js +39 -0
  146. package/packages/config-markdownlint/node_modules/markdownlint/lib/md020.js +62 -0
  147. package/packages/config-markdownlint/node_modules/markdownlint/lib/md021.js +62 -0
  148. package/packages/config-markdownlint/node_modules/markdownlint/lib/md022.js +108 -0
  149. package/packages/config-markdownlint/node_modules/markdownlint/lib/md023.js +38 -0
  150. package/packages/config-markdownlint/node_modules/markdownlint/lib/md024.js +38 -0
  151. package/packages/config-markdownlint/node_modules/markdownlint/lib/md025.js +32 -0
  152. package/packages/config-markdownlint/node_modules/markdownlint/lib/md026.js +50 -0
  153. package/packages/config-markdownlint/node_modules/markdownlint/lib/md027.js +56 -0
  154. package/packages/config-markdownlint/node_modules/markdownlint/lib/md028.js +30 -0
  155. package/packages/config-markdownlint/node_modules/markdownlint/lib/md029.js +67 -0
  156. package/packages/config-markdownlint/node_modules/markdownlint/lib/md030.js +61 -0
  157. package/packages/config-markdownlint/node_modules/markdownlint/lib/md031.js +40 -0
  158. package/packages/config-markdownlint/node_modules/markdownlint/lib/md032.js +78 -0
  159. package/packages/config-markdownlint/node_modules/markdownlint/lib/md033.js +39 -0
  160. package/packages/config-markdownlint/node_modules/markdownlint/lib/md034.js +79 -0
  161. package/packages/config-markdownlint/node_modules/markdownlint/lib/md035.js +24 -0
  162. package/packages/config-markdownlint/node_modules/markdownlint/lib/md036.js +56 -0
  163. package/packages/config-markdownlint/node_modules/markdownlint/lib/md037.js +91 -0
  164. package/packages/config-markdownlint/node_modules/markdownlint/lib/md038.js +97 -0
  165. package/packages/config-markdownlint/node_modules/markdownlint/lib/md039.js +67 -0
  166. package/packages/config-markdownlint/node_modules/markdownlint/lib/md040.js +37 -0
  167. package/packages/config-markdownlint/node_modules/markdownlint/lib/md041.js +42 -0
  168. package/packages/config-markdownlint/node_modules/markdownlint/lib/md042.js +49 -0
  169. package/packages/config-markdownlint/node_modules/markdownlint/lib/md043.js +64 -0
  170. package/packages/config-markdownlint/node_modules/markdownlint/lib/md044.js +107 -0
  171. package/packages/config-markdownlint/node_modules/markdownlint/lib/md045.js +60 -0
  172. package/packages/config-markdownlint/node_modules/markdownlint/lib/md046.js +33 -0
  173. package/packages/config-markdownlint/node_modules/markdownlint/lib/md047.js +28 -0
  174. package/packages/config-markdownlint/node_modules/markdownlint/lib/md048.js +30 -0
  175. package/packages/config-markdownlint/node_modules/markdownlint/lib/md049-md050.js +89 -0
  176. package/packages/config-markdownlint/node_modules/markdownlint/lib/md051.js +172 -0
  177. package/packages/config-markdownlint/node_modules/markdownlint/lib/md052.js +39 -0
  178. package/packages/config-markdownlint/node_modules/markdownlint/lib/md053.js +59 -0
  179. package/packages/config-markdownlint/node_modules/markdownlint/lib/md054.js +125 -0
  180. package/packages/config-markdownlint/node_modules/markdownlint/lib/rules.js +65 -0
  181. package/packages/config-markdownlint/node_modules/markdownlint/package.json +109 -0
  182. package/packages/config-markdownlint/node_modules/markdownlint/schema/.markdownlint.jsonc +297 -0
  183. package/packages/config-markdownlint/node_modules/markdownlint/schema/.markdownlint.yaml +266 -0
  184. package/packages/config-markdownlint/node_modules/markdownlint/schema/markdownlint-config-schema.json +1762 -0
  185. package/packages/config-markdownlint/node_modules/markdownlint/style/all.json +5 -0
  186. package/packages/config-markdownlint/node_modules/markdownlint/style/cirosantilli.json +22 -0
  187. package/packages/config-markdownlint/node_modules/markdownlint/style/prettier.json +26 -0
  188. package/packages/config-markdownlint/node_modules/markdownlint/style/relaxed.json +12 -0
  189. package/packages/config-markdownlint/package.json +3 -3
  190. package/packages/config-prettier/README.md +16 -0
  191. package/packages/config-prettier/package.json +4 -4
  192. package/packages/config-stylelint/package.json +2 -2
  193. package/scripts/semver.sh +6 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexlit/lint-kit",
3
- "version": "107.0.0",
3
+ "version": "107.2.0",
4
4
  "private": false,
5
5
  "description": "Preset of configuration files and dependencies for linting web applications (designed for Vue.js with TypeScript)",
6
6
  "keywords": [
@@ -63,16 +63,6 @@
63
63
  "semver": "./scripts/semver.sh",
64
64
  "up": "./scripts/up.sh"
65
65
  },
66
- "dependencies": {
67
- "@alexlit/config-commitlint": "^10.1.0",
68
- "@alexlit/config-eslint": "^70.1.2",
69
- "@alexlit/config-hooks": "^0.0.2",
70
- "@alexlit/config-htmllint": "^1.0.1",
71
- "@alexlit/config-markdownlint": "^2.0.2",
72
- "@alexlit/config-npmlint": "^5.0.1",
73
- "@alexlit/config-prettier": "^14.0.2",
74
- "@alexlit/config-stylelint": "^38.5.0"
75
- },
76
66
  "devDependencies": {
77
67
  "changelogen": "latest",
78
68
  "typescript": "^5.2.2"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexlit/config-commitlint",
3
- "version": "10.2.0",
3
+ "version": "10.2.1",
4
4
  "private": false,
5
5
  "description": "Commitlint config",
6
6
  "keywords": [
@@ -31,7 +31,7 @@
31
31
  "up": "../../scripts/up.sh"
32
32
  },
33
33
  "dependencies": {
34
- "@commitlint/cli": "^18.4.0",
34
+ "@commitlint/cli": "^18.4.1",
35
35
  "@commitlint/config-conventional": "^18.4.0",
36
36
  "conventional-changelog-cli": "^4.1.0"
37
37
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexlit/config-eslint",
3
- "version": "70.4.0",
3
+ "version": "70.5.0",
4
4
  "private": false,
5
5
  "description": "Eslint config",
6
6
  "keywords": [
@@ -34,9 +34,9 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@intlify/eslint-plugin-vue-i18n": "^2.0.0",
37
- "@tanstack/eslint-plugin-query": "^5.6.0",
38
- "@typescript-eslint/eslint-plugin": "^6.10.0",
39
- "@typescript-eslint/parser": "^6.10.0",
37
+ "@tanstack/eslint-plugin-query": "^5.8.3",
38
+ "@typescript-eslint/eslint-plugin": "^6.11.0",
39
+ "@typescript-eslint/parser": "^6.11.0",
40
40
  "eslint": "^8.53.0",
41
41
  "eslint-config-airbnb-base": "^15.0.0",
42
42
  "eslint-config-prettier": "^9.0.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexlit/config-hooks",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "private": false,
5
5
  "description": "Hooks config",
6
6
  "keywords": [
@@ -33,6 +33,6 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "husky": "^4.3.8",
36
- "lint-staged": "^15.0.2"
36
+ "lint-staged": "^15.1.0"
37
37
  }
38
- }
38
+ }
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Vitaly Puzrin, Alex Kocharin.
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,309 @@
1
+ # markdown-it <!-- omit in toc -->
2
+
3
+ [![CI](https://github.com/markdown-it/markdown-it/workflows/CI/badge.svg)](https://github.com/markdown-it/markdown-it/actions)
4
+ [![NPM version](https://img.shields.io/npm/v/markdown-it.svg?style=flat)](https://www.npmjs.org/package/markdown-it)
5
+ [![Coverage Status](https://coveralls.io/repos/markdown-it/markdown-it/badge.svg?branch=master&service=github)](https://coveralls.io/github/markdown-it/markdown-it?branch=master)
6
+ [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/markdown-it/markdown-it)
7
+
8
+ > Markdown parser done right. Fast and easy to extend.
9
+
10
+ __[Live demo](https://markdown-it.github.io)__
11
+
12
+ - Follows the __[CommonMark spec](http://spec.commonmark.org/)__ + adds syntax extensions & sugar (URL autolinking, typographer).
13
+ - Configurable syntax! You can add new rules and even replace existing ones.
14
+ - High speed.
15
+ - [Safe](https://github.com/markdown-it/markdown-it/tree/master/docs/security.md) by default.
16
+ - Community-written __[plugins](https://www.npmjs.org/browse/keyword/markdown-it-plugin)__ and [other packages](https://www.npmjs.org/browse/keyword/markdown-it) on npm.
17
+
18
+ __Table of content__
19
+
20
+ - [Install](#install)
21
+ - [Usage examples](#usage-examples)
22
+ - [Simple](#simple)
23
+ - [Init with presets and options](#init-with-presets-and-options)
24
+ - [Plugins load](#plugins-load)
25
+ - [Syntax highlighting](#syntax-highlighting)
26
+ - [Linkify](#linkify)
27
+ - [API](#api)
28
+ - [Syntax extensions](#syntax-extensions)
29
+ - [Manage rules](#manage-rules)
30
+ - [Benchmark](#benchmark)
31
+ - [markdown-it for enterprise](#markdown-it-for-enterprise)
32
+ - [Authors](#authors)
33
+ - [References / Thanks](#references--thanks)
34
+
35
+ ## Install
36
+
37
+ **node.js**:
38
+
39
+ ```bash
40
+ npm install markdown-it --save
41
+ ```
42
+
43
+ **browser (CDN):**
44
+
45
+ - [jsDeliver CDN](http://www.jsdelivr.com/#!markdown-it "jsDelivr CDN")
46
+ - [cdnjs.com CDN](https://cdnjs.com/libraries/markdown-it "cdnjs.com")
47
+
48
+
49
+ ## Usage examples
50
+
51
+ See also:
52
+
53
+ - __[API documentation](https://markdown-it.github.io/markdown-it/)__ - for more
54
+ info and examples.
55
+ - [Development info](https://github.com/markdown-it/markdown-it/tree/master/docs) -
56
+ for plugins writers.
57
+
58
+
59
+ ### Simple
60
+
61
+ ```js
62
+ // node.js, "classic" way:
63
+ var MarkdownIt = require('markdown-it'),
64
+ md = new MarkdownIt();
65
+ var result = md.render('# markdown-it rulezz!');
66
+
67
+ // node.js, the same, but with sugar:
68
+ var md = require('markdown-it')();
69
+ var result = md.render('# markdown-it rulezz!');
70
+
71
+ // browser without AMD, added to "window" on script load
72
+ // Note, there is no dash in "markdownit".
73
+ var md = window.markdownit();
74
+ var result = md.render('# markdown-it rulezz!');
75
+ ```
76
+
77
+ Single line rendering, without paragraph wrap:
78
+
79
+ ```js
80
+ var md = require('markdown-it')();
81
+ var result = md.renderInline('__markdown-it__ rulezz!');
82
+ ```
83
+
84
+
85
+ ### Init with presets and options
86
+
87
+ (*) presets define combinations of active rules and options. Can be
88
+ `"commonmark"`, `"zero"` or `"default"` (if skipped). See
89
+ [API docs](https://markdown-it.github.io/markdown-it/#MarkdownIt.new) for more details.
90
+
91
+ ```js
92
+ // commonmark mode
93
+ var md = require('markdown-it')('commonmark');
94
+
95
+ // default mode
96
+ var md = require('markdown-it')();
97
+
98
+ // enable everything
99
+ var md = require('markdown-it')({
100
+ html: true,
101
+ linkify: true,
102
+ typographer: true
103
+ });
104
+
105
+ // full options list (defaults)
106
+ var md = require('markdown-it')({
107
+ html: false, // Enable HTML tags in source
108
+ xhtmlOut: false, // Use '/' to close single tags (<br />).
109
+ // This is only for full CommonMark compatibility.
110
+ breaks: false, // Convert '\n' in paragraphs into <br>
111
+ langPrefix: 'language-', // CSS language prefix for fenced blocks. Can be
112
+ // useful for external highlighters.
113
+ linkify: false, // Autoconvert URL-like text to links
114
+
115
+ // Enable some language-neutral replacement + quotes beautification
116
+ // For the full list of replacements, see https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.js
117
+ typographer: false,
118
+
119
+ // Double + single quotes replacement pairs, when typographer enabled,
120
+ // and smartquotes on. Could be either a String or an Array.
121
+ //
122
+ // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
123
+ // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
124
+ quotes: '“”‘’',
125
+
126
+ // Highlighter function. Should return escaped HTML,
127
+ // or '' if the source string is not changed and should be escaped externally.
128
+ // If result starts with <pre... internal wrapper is skipped.
129
+ highlight: function (/*str, lang*/) { return ''; }
130
+ });
131
+ ```
132
+
133
+ ### Plugins load
134
+
135
+ ```js
136
+ var md = require('markdown-it')()
137
+ .use(plugin1)
138
+ .use(plugin2, opts, ...)
139
+ .use(plugin3);
140
+ ```
141
+
142
+
143
+ ### Syntax highlighting
144
+
145
+ Apply syntax highlighting to fenced code blocks with the `highlight` option:
146
+
147
+ ```js
148
+ var hljs = require('highlight.js'); // https://highlightjs.org
149
+
150
+ // Actual default values
151
+ var md = require('markdown-it')({
152
+ highlight: function (str, lang) {
153
+ if (lang && hljs.getLanguage(lang)) {
154
+ try {
155
+ return hljs.highlight(str, { language: lang }).value;
156
+ } catch (__) {}
157
+ }
158
+
159
+ return ''; // use external default escaping
160
+ }
161
+ });
162
+ ```
163
+
164
+ Or with full wrapper override (if you need assign class to `<pre>`):
165
+
166
+ ```js
167
+ var hljs = require('highlight.js'); // https://highlightjs.org
168
+
169
+ // Actual default values
170
+ var md = require('markdown-it')({
171
+ highlight: function (str, lang) {
172
+ if (lang && hljs.getLanguage(lang)) {
173
+ try {
174
+ return '<pre class="hljs"><code>' +
175
+ hljs.highlight(str, { language: lang, ignoreIllegals: true }).value +
176
+ '</code></pre>';
177
+ } catch (__) {}
178
+ }
179
+
180
+ return '<pre class="hljs"><code>' + md.utils.escapeHtml(str) + '</code></pre>';
181
+ }
182
+ });
183
+ ```
184
+
185
+ ### Linkify
186
+
187
+ `linkify: true` uses [linkify-it](https://github.com/markdown-it/linkify-it). To
188
+ configure linkify-it, access the linkify instance through `md.linkify`:
189
+
190
+ ```js
191
+ md.linkify.set({ fuzzyEmail: false }); // disables converting email to link
192
+ ```
193
+
194
+
195
+ ## API
196
+
197
+ __[API documentation](https://markdown-it.github.io/markdown-it/)__
198
+
199
+ If you are going to write plugins, please take a look at
200
+ [Development info](https://github.com/markdown-it/markdown-it/tree/master/docs).
201
+
202
+
203
+ ## Syntax extensions
204
+
205
+ Embedded (enabled by default):
206
+
207
+ - [Tables](https://help.github.com/articles/organizing-information-with-tables/) (GFM)
208
+ - [Strikethrough](https://help.github.com/articles/basic-writing-and-formatting-syntax/#styling-text) (GFM)
209
+
210
+ Via plugins:
211
+
212
+ - [subscript](https://github.com/markdown-it/markdown-it-sub)
213
+ - [superscript](https://github.com/markdown-it/markdown-it-sup)
214
+ - [footnote](https://github.com/markdown-it/markdown-it-footnote)
215
+ - [definition list](https://github.com/markdown-it/markdown-it-deflist)
216
+ - [abbreviation](https://github.com/markdown-it/markdown-it-abbr)
217
+ - [emoji](https://github.com/markdown-it/markdown-it-emoji)
218
+ - [custom container](https://github.com/markdown-it/markdown-it-container)
219
+ - [insert](https://github.com/markdown-it/markdown-it-ins)
220
+ - [mark](https://github.com/markdown-it/markdown-it-mark)
221
+ - ... and [others](https://www.npmjs.org/browse/keyword/markdown-it-plugin)
222
+
223
+
224
+ ### Manage rules
225
+
226
+ By default all rules are enabled, but can be restricted by options. On plugin
227
+ load all its rules are enabled automatically.
228
+
229
+ ```js
230
+ // Activate/deactivate rules, with currying
231
+ var md = require('markdown-it')()
232
+ .disable([ 'link', 'image' ])
233
+ .enable([ 'link' ])
234
+ .enable('image');
235
+
236
+ // Enable everything
237
+ md = require('markdown-it')({
238
+ html: true,
239
+ linkify: true,
240
+ typographer: true,
241
+ });
242
+ ```
243
+
244
+ You can find all rules in sources:
245
+
246
+ - [`parser_core.js`](lib/parser_core.js)
247
+ - [`parser_block.js`](lib/parser_block.js)
248
+ - [`parser_inline.js`](lib/parser_inline.js)
249
+
250
+
251
+ ## Benchmark
252
+
253
+ Here is the result of readme parse at MB Pro Retina 2013 (2.4 GHz):
254
+
255
+ ```bash
256
+ make benchmark-deps
257
+ benchmark/benchmark.js readme
258
+
259
+ Selected samples: (1 of 28)
260
+ > README
261
+
262
+ Sample: README.md (7774 bytes)
263
+ > commonmark-reference x 1,222 ops/sec ±0.96% (97 runs sampled)
264
+ > current x 743 ops/sec ±0.84% (97 runs sampled)
265
+ > current-commonmark x 1,568 ops/sec ±0.84% (98 runs sampled)
266
+ > marked x 1,587 ops/sec ±4.31% (93 runs sampled)
267
+ ```
268
+
269
+ __Note.__ CommonMark version runs with [simplified link normalizers](https://github.com/markdown-it/markdown-it/blob/master/benchmark/implementations/current-commonmark/index.js)
270
+ for more "honest" compare. Difference is ≈1.5×.
271
+
272
+ As you can see, `markdown-it` doesn't pay with speed for its flexibility.
273
+ Slowdown of "full" version caused by additional features not available in
274
+ other implementations.
275
+
276
+
277
+ ## markdown-it for enterprise
278
+
279
+ Available as part of the Tidelift Subscription.
280
+
281
+ The maintainers of `markdown-it` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-markdown-it?utm_source=npm-markdown-it&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
282
+
283
+
284
+ ## Authors
285
+
286
+ - Alex Kocharin [github/rlidwka](https://github.com/rlidwka)
287
+ - Vitaly Puzrin [github/puzrin](https://github.com/puzrin)
288
+
289
+ _markdown-it_ is the result of the decision of the authors who contributed to
290
+ 99% of the _Remarkable_ code to move to a project with the same authorship but
291
+ new leadership (Vitaly and Alex). It's not a fork.
292
+
293
+ ## References / Thanks
294
+
295
+ Big thanks to [John MacFarlane](https://github.com/jgm) for his work on the
296
+ CommonMark spec and reference implementations. His work saved us a lot of time
297
+ during this project's development.
298
+
299
+ **Related Links:**
300
+
301
+ - https://github.com/jgm/CommonMark - reference CommonMark implementations in C & JS,
302
+ also contains latest spec & online demo.
303
+ - http://talk.commonmark.org - CommonMark forum, good place to collaborate
304
+ developers' efforts.
305
+
306
+ **Ports**
307
+
308
+ - [motion-markdown-it](https://github.com/digitalmoksha/motion-markdown-it) - Ruby/RubyMotion
309
+ - [markdown-it-py](https://github.com/ExecutableBookProject/markdown-it-py)- Python
@@ -0,0 +1,117 @@
1
+ #!/usr/bin/env node
2
+ /*eslint no-console:0*/
3
+
4
+ 'use strict';
5
+
6
+
7
+ var fs = require('fs');
8
+ var argparse = require('argparse');
9
+
10
+
11
+ ////////////////////////////////////////////////////////////////////////////////
12
+
13
+ var cli = new argparse.ArgumentParser({
14
+ prog: 'markdown-it',
15
+ add_help: true
16
+ });
17
+
18
+ cli.add_argument('-v', '--version', {
19
+ action: 'version',
20
+ version: require('../package.json').version
21
+ });
22
+
23
+ cli.add_argument('--no-html', {
24
+ help: 'Disable embedded HTML',
25
+ action: 'store_true'
26
+ });
27
+
28
+ cli.add_argument('-l', '--linkify', {
29
+ help: 'Autolink text',
30
+ action: 'store_true'
31
+ });
32
+
33
+ cli.add_argument('-t', '--typographer', {
34
+ help: 'Enable smartquotes and other typographic replacements',
35
+ action: 'store_true'
36
+ });
37
+
38
+ cli.add_argument('--trace', {
39
+ help: 'Show stack trace on error',
40
+ action: 'store_true'
41
+ });
42
+
43
+ cli.add_argument('file', {
44
+ help: 'File to read',
45
+ nargs: '?',
46
+ default: '-'
47
+ });
48
+
49
+ cli.add_argument('-o', '--output', {
50
+ help: 'File to write',
51
+ default: '-'
52
+ });
53
+
54
+ var options = cli.parse_args();
55
+
56
+
57
+ function readFile(filename, encoding, callback) {
58
+ if (options.file === '-') {
59
+ // read from stdin
60
+ var chunks = [];
61
+
62
+ process.stdin.on('data', function (chunk) { chunks.push(chunk); });
63
+
64
+ process.stdin.on('end', function () {
65
+ return callback(null, Buffer.concat(chunks).toString(encoding));
66
+ });
67
+ } else {
68
+ fs.readFile(filename, encoding, callback);
69
+ }
70
+ }
71
+
72
+
73
+ ////////////////////////////////////////////////////////////////////////////////
74
+
75
+ readFile(options.file, 'utf8', function (err, input) {
76
+ var output, md;
77
+
78
+ if (err) {
79
+ if (err.code === 'ENOENT') {
80
+ console.error('File not found: ' + options.file);
81
+ process.exit(2);
82
+ }
83
+
84
+ console.error(
85
+ options.trace && err.stack ||
86
+ err.message ||
87
+ String(err));
88
+
89
+ process.exit(1);
90
+ }
91
+
92
+ md = require('..')({
93
+ html: !options.no_html,
94
+ xhtmlOut: false,
95
+ typographer: options.typographer,
96
+ linkify: options.linkify
97
+ });
98
+
99
+ try {
100
+ output = md.render(input);
101
+
102
+ } catch (e) {
103
+ console.error(
104
+ options.trace && e.stack ||
105
+ e.message ||
106
+ String(e));
107
+
108
+ process.exit(1);
109
+ }
110
+
111
+ if (options.output === '-') {
112
+ // write to stdout
113
+ process.stdout.write(output);
114
+ } else {
115
+ fs.writeFileSync(options.output, output);
116
+ }
117
+ });