Skip to content

Commit

Permalink
fix(rule): "々"を漢字から除外する
Browse files Browse the repository at this point in the history
fix #48
  • Loading branch information
azu committed Jul 12, 2016
1 parent 139a30c commit 63f91f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/util/regexp.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// LICENSE : MIT
"use strict";
export const japaneseRegExp = /(?:[々〇〻\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF]|[\uD840-\uD87F][\uDC00-\uDFFF]|[ぁ-んァ-ヶ])/;
// http://tama-san.com/kanji-regex/
export const kanjiRegExp = /(?:[々〇〻\u3400-\u9FFF\uF900-\uFAFF]|[\uD840-\uD87F][\uDC00-\uDFFF])/;
// http://tama-san.com/kanji-regex/ ベース
// "々" は 記号であるため除外
// https://github.com/azu/textlint-rule-preset-JTF-style/issues/48
export const kanjiRegExp = /(?:[〇〻\u3400-\u9FFF\uF900-\uFAFF]|[\uD840-\uD87F][\uDC00-\uDFFF])/;
export const hiraganaRegExp = /[ぁ-ん]/;
export const karakanaRegExp = /[ァ-ヶ]/;
// 半角カタカナ
Expand Down
3 changes: 2 additions & 1 deletion test/2.1.2-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import rule from "../src/2.1.2";
var tester = new TextLintTester();
tester.run("2.1.2.漢字", rule, {
valid: [
"今日は日本語の勉強をします。"
"今日は日本語の勉強をします。",
"度々問題が起きる。"
],
invalid: [
{
Expand Down

0 comments on commit 63f91f9

Please sign in to comment.