@putout/processor-markdown 7.3.0 → 8.0.1

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.
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  >
8
8
  > (c) [markdownguide.org](https://www.markdownguide.org/)
9
9
 
10
- 🐊[**Putout**](https://github.com/coderaiser/putout) processor adds ability to get **JavaScript**, **JSON** and **TypeScript** code from **Markdown** files.
10
+ 🐊[**Putout**](https://github.com/coderaiser/putout) processor adds ability to get **JavaScript**, **JSX**, **JSON** and **TypeScript** code from **Markdown** files.
11
11
 
12
12
  ## Install
13
13
 
package/lib/markdown.js CHANGED
@@ -41,6 +41,9 @@ export const files = [
41
41
  export const find = async (rawSource, options = {}) => {
42
42
  await parseStore.init();
43
43
 
44
+ if (!rawSource.length)
45
+ return [];
46
+
44
47
  const {messages} = await unified()
45
48
  .use(parseStore)
46
49
  .use(preset)
@@ -183,7 +186,6 @@ const apply = ({list, visit}) => (node) => {
183
186
 
184
187
  if (lang === 'json') {
185
188
  const code = list.shift();
186
-
187
189
  node.value = fromJS(code);
188
190
  }
189
191
  });
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@putout/processor-markdown",
3
- "version": "7.3.0",
3
+ "version": "8.0.1",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
- "description": "🐊Putout processor adds ability to parse markdown files and lint js snippets",
6
+ "description": "🐊Putout processor adds ability to parse markdown files and lint JavaScript, JSX, TypeScript and JSON snippets",
7
7
  "homepage": "https://github.com/coderaiser/putout/tree/master/packages/processor-markdown#readme",
8
8
  "main": "./lib/markdown.js",
9
+ "commitType": "colon",
9
10
  "exports": {
10
11
  ".": "./lib/markdown.js",
11
12
  "./parse-store": "./lib/parse-store.js"
@@ -50,16 +51,16 @@
50
51
  "eslint": "^8.0.1",
51
52
  "eslint-plugin-n": "^15.2.4",
52
53
  "eslint-plugin-putout": "^16.0.0",
53
- "lerna": "^5.0.0",
54
+ "lerna": "^6.0.1",
54
55
  "madcut": "^1.0.0",
55
56
  "madrun": "^9.0.0",
56
57
  "montag": "^1.2.1",
57
58
  "nodemon": "^2.0.1",
58
59
  "putout": "*",
59
- "supertape": "^7.0.0"
60
+ "supertape": "^8.0.0"
60
61
  },
61
62
  "peerDependencies": {
62
- "putout": ">=26"
63
+ "putout": ">=28"
63
64
  },
64
65
  "engines": {
65
66
  "node": ">=16"