Skip to content

Commit

Permalink
fix(rule): avoid -index
Browse files Browse the repository at this point in the history
  • Loading branch information
azu committed May 4, 2016
1 parent 1a49049 commit c807d83
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/textlint-rule-no-nfd.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ function reporter(context) {
}
const text = getSource(node);
matchCaptureGroupAll(text, /([\u309b\u309c\u309a\u3099])/g).forEach(({index}) => {
if (index === 0) {
return;
}
// \u309b\u309c => \u309a\u3099
const dakutenChars = text.slice(index - 1, index + 1);
const nfdlized = dakutenChars.replace("\u309B", "\u3099").replace("\u309C", "\u309A")
Expand Down

0 comments on commit c807d83

Please sign in to comment.