@putout/processor-markdown 7.1.0 → 7.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 (2) hide show
  1. package/lib/markdown.js +22 -2
  2. package/package.json +3 -1
package/lib/markdown.js CHANGED
@@ -114,6 +114,16 @@ const collect = ({list, visit}) => (node) => {
114
114
  return;
115
115
  }
116
116
 
117
+ if (lang === 'jsx') {
118
+ list.push({
119
+ startLine,
120
+ source: value,
121
+ extension: 'jsx',
122
+ });
123
+
124
+ return;
125
+ }
126
+
117
127
  if (/^(ts|typescript)$/.test(lang)) {
118
128
  list.push({
119
129
  startLine,
@@ -124,6 +134,16 @@ const collect = ({list, visit}) => (node) => {
124
134
  return;
125
135
  }
126
136
 
137
+ if (lang === 'tsx') {
138
+ list.push({
139
+ startLine,
140
+ source: value,
141
+ extension: 'tsx',
142
+ });
143
+
144
+ return;
145
+ }
146
+
127
147
  if (lang === 'json') {
128
148
  const source = toJS(value);
129
149
 
@@ -140,12 +160,12 @@ const apply = ({list, visit}) => (node) => {
140
160
  visit(node, 'code', (node) => {
141
161
  const {lang} = node;
142
162
 
143
- if (/^(js|javascript)$/.test(lang)) {
163
+ if (/^(jsx?|javascript)$/.test(lang)) {
144
164
  node.value = list.shift();
145
165
  return;
146
166
  }
147
167
 
148
- if (/^(ts|typescript)$/.test(lang)) {
168
+ if (/^(tsx?|typescript)$/.test(lang)) {
149
169
  node.value = list.shift();
150
170
  return;
151
171
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/processor-markdown",
3
- "version": "7.1.0",
3
+ "version": "7.2.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout processor adds ability to parse markdown files and lint js snippets",
@@ -21,6 +21,7 @@
21
21
  "lint:fresh": "madrun lint:fresh",
22
22
  "fix:lint": "madrun fix:lint",
23
23
  "coverage": "madrun coverage",
24
+ "coverage:old": "madrun coverage:old",
24
25
  "report": "madrun report"
25
26
  },
26
27
  "dependencies": {
@@ -41,6 +42,7 @@
41
42
  "devDependencies": {
42
43
  "@putout/test": "^5.0.0",
43
44
  "c8": "^7.5.0",
45
+ "escover": "^2.1.2",
44
46
  "eslint": "^8.0.1",
45
47
  "eslint-plugin-node": "^11.0.0",
46
48
  "eslint-plugin-putout": "^15.0.0",