Skip to content

Commit 77f484c

Browse files
committed
docs(rule): add comment for step
1 parent e9e8e06 commit 77f484c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/textlint-rule-ja-no-mixed-period.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const reporter = (context, options = {}) => {
2323
return;
2424
}
2525
const lastStrText = getSource(lastNode);
26+
// 日本語が含まれていない文章は無視する
2627
if (!japaneseRegExp.test(lastStrText)) {
2728
return;
2829
}
@@ -31,6 +32,7 @@ const reporter = (context, options = {}) => {
3132
if (lastChar === undefined) {
3233
return;
3334
}
35+
// 末尾の"文字"が句点以外で末尾に使われる文字であるときは無視する
3436
// 例外: 感嘆符
3537
// 例外: 「」 () ()『』
3638
// http://ncode.syosetu.com/n8977bb/12/
@@ -41,7 +43,8 @@ const reporter = (context, options = {}) => {
4143
if (lastChar === periodMark) {
4244
return;
4345
}
44-
46+
// "." であるなら "。"に変換
47+
// そうでない場合は末尾に"。"を追加する
4548
let fix = null;
4649
if (defaultPeriodMark.test(lastChar)) {
4750
fix = fixer.replaceTextRange([lastIndex, lastIndex + 1], periodMark);

0 commit comments

Comments
 (0)