-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
textlint/textlint-plugin-html
#23Labels
Type: BugBug or Bug fixesBug or Bug fixes
Description
再現手順
設定(textlintrc)
{
"plugins": [
"html"
],
"rules": {
"@textlint-ja/no-synonyms": true
}
}
試した文章(test.html)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Title</title>
</head>
<body>
<p>サーバとサーバーの表記揺れがある。</p>
<p>この雇入と雇入れの違いを見つける。</p>
</body>
</html>
実行結果。
$ npx textlint --c textlintrc test.html
<< 結果の出力無し >>
期待する結果
- 「サーバ」と「サーバー」、「雇入」と「雇入れ」それぞれが同義語として検出される。
実際の結果
- どちらも検出されない。
ワークアラウンド
body 内のみの記述にすると検出されます。
試した文章(test-body.html)
<p>サーバとサーバーの表記揺れがある。</p>
<p>この雇入と雇入れの違いを見つける。</p>
実行結果。
$ npx textlint --c textlintrc test-body.html
/sandbox/reproduce/no-synonym-html/test-body.html
1:8 error 同義語である「サーバ」と「サーバー」が利用されています @textlint-ja/no-synonyms
2:9 error 同義語である「雇入」と「雇入れ」が利用されています @textlint-ja/no-synonyms
✖ 2 problems (2 errors, 0 warnings)
ワークアラウンドの HTML から作成される AST は Document
の直下に Paragraph
が作成されます。
一方で、<html><body></body></html>
で囲まれていると AST は Document/Html/Html
となります。
そのため、以下の設定により除外されていると予想しています。
ignoreNodeTypes: [Syntax.BlockQuote, Syntax.CodeBlock, Syntax.Code, Syntax.Html, Syntax.Link, Syntax.Image, Syntax.Comment] |
Metadata
Metadata
Assignees
Labels
Type: BugBug or Bug fixesBug or Bug fixes