Commit ea05e27
fix(rule): Ignore empty paragraph (#1)
* Ignore empty Paragraph. Ex) '<p></p>'
When applying `textlint-rule-prefer-tari-tari` to HTML, an error
occurred.
`` `console
✖ Stack trace
TypeError: Can not read property 'children' of undefined
at
/usr/local/lib/node_modules/textlint-rule-prefer-tari-tari/lib/textlint-
rule-prefer-tari-tari.js:56:44
at <anonymous>
at process._ tickCallback (internal / process / next_tick.js: 188:
7)
`` `
I checked the contents of the NODE where the error occurred.
`` `console
### NODE
{type: 'Paragraph',
tagName: 'p',
properties: {},
children: [],
loc:
{start: {line: 19, column: 12},
end: {line: 19, column: 19}},
range: [50138, 50145],
raw: '<p> </ p>'}
### CST
{type: 'RootNode', children: [], position: {}}
### CST.children
[]
`` `
Fixed the program to ignore empty Paragraph like `<p> </ p>`.
* Merge upstream
* Merge upstream
* Merge upstream
* Merge upstream
* Update textlint-rule-prefer-tari-tari.js
* Update textlint-rule-prefer-tari-tari.js1 parent 2c7963f commit ea05e27
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
| |||
0 commit comments