diff --git a/src/4.2.6.js b/src/4.2.6.js index c43a1f8..194d71f 100644 --- a/src/4.2.6.js +++ b/src/4.2.6.js @@ -28,6 +28,11 @@ module.exports = function (context) { const matches = mergeMatches(leftMatches, rightMatches); matches.forEach((match) => { const { index } = match; + // 数値の符号としてのハイフンは許可する + const nextChar = text[index + 1]; + if (nextChar && /[0-9]/.test(nextChar)) { + return; + } report( node, new RuleError( diff --git a/test/4.2.6-test.js b/test/4.2.6-test.js index 970a600..1870fbc 100644 --- a/test/4.2.6-test.js +++ b/test/4.2.6-test.js @@ -8,7 +8,8 @@ tester.run("4.2.6.ハイフン(-)", rule, { "千代田区一番町 1-1-1", "03-5555-xxxxx", "電話番号は090-1234-5678です", - "Allen Wirfs-Brock(アレン・ワーフスブラック)" + "Allen Wirfs-Brock(アレン・ワーフスブラック)", + "サイン関数は-1から1の範囲の値をとる" ], invalid: [ {