Skip to content

Commit c807d83

Browse files
committed
fix(rule): avoid -index
1 parent 1a49049 commit c807d83

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/textlint-rule-no-nfd.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ function reporter(context) {
1313
}
1414
const text = getSource(node);
1515
matchCaptureGroupAll(text, /([\u309b\u309c\u309a\u3099])/g).forEach(({index}) => {
16+
if (index === 0) {
17+
return;
18+
}
1619
// \u309b\u309c => \u309a\u3099
1720
const dakutenChars = text.slice(index - 1, index + 1);
1821
const nfdlized = dakutenChars.replace("\u309B", "\u3099").replace("\u309C", "\u309A")

0 commit comments

Comments
 (0)