From dfc41a806d5d9381d4d5d428b949aaed32338829 Mon Sep 17 00:00:00 2001 From: 3w36zj6 <52315048+3w36zj6@users.noreply.github.com> Date: Mon, 22 Sep 2025 21:58:07 +0900 Subject: [PATCH] =?UTF-8?q?fix(4.2.6):=20=E6=95=B0=E5=80=A4=E3=81=AE?= =?UTF-8?q?=E7=AC=A6=E5=8F=B7=E3=81=A8=E3=81=97=E3=81=A6=E3=81=AE=E3=83=8F?= =?UTF-8?q?=E3=82=A4=E3=83=95=E3=83=B3=E3=82=92=E8=A8=B1=E5=8F=AF=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/4.2.6.js | 5 +++++ test/4.2.6-test.js | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) 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: [ {