Skip to content

Commit 63f91f9

Browse files
committed
fix(rule): "々"を漢字から除外する
fix #48
1 parent 139a30c commit 63f91f9

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/util/regexp.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
// LICENSE : MIT
22
"use strict";
33
export const japaneseRegExp = /(?:[\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF]|[\uD840-\uD87F][\uDC00-\uDFFF]|[--])/;
4-
// http://tama-san.com/kanji-regex/
5-
export const kanjiRegExp = /(?:[\u3400-\u9FFF\uF900-\uFAFF]|[\uD840-\uD87F][\uDC00-\uDFFF])/;
4+
// http://tama-san.com/kanji-regex/ ベース
5+
// "々" は 記号であるため除外
6+
// https://github.com/azu/textlint-rule-preset-JTF-style/issues/48
7+
export const kanjiRegExp = /(?:[\u3400-\u9FFF\uF900-\uFAFF]|[\uD840-\uD87F][\uDC00-\uDFFF])/;
68
export const hiraganaRegExp = /[-]/;
79
export const karakanaRegExp = /[-]/;
810
// 半角カタカナ

test/2.1.2-test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import rule from "../src/2.1.2";
55
var tester = new TextLintTester();
66
tester.run("2.1.2.漢字", rule, {
77
valid: [
8-
"今日は日本語の勉強をします。"
8+
"今日は日本語の勉強をします。",
9+
"度々問題が起きる。"
910
],
1011
invalid: [
1112
{

0 commit comments

Comments
 (0)