From a4f40405eff63bf8b85424500ba0184f8b4eddf8 Mon Sep 17 00:00:00 2001 From: Izai Alejandro Zalles Merino Date: Mon, 13 Oct 2025 09:33:45 -0400 Subject: [PATCH] feat(magic): improve Morse detection (slash-separated variants) - Add Magic checks for common Morse format using forward slashes between words - Cover dot/dash, underscore/dot, and dash/dot literal formats with slashes Authored-by: Izai Alejandro Zalles Merino --- src/core/operations/FromMorseCode.mjs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/core/operations/FromMorseCode.mjs b/src/core/operations/FromMorseCode.mjs index b0aa4ef2..8dacfb4a 100644 --- a/src/core/operations/FromMorseCode.mjs +++ b/src/core/operations/FromMorseCode.mjs @@ -42,8 +42,20 @@ class FromMorseCode extends Operation { pattern: "(?:^[-. \\n]{5,}$|^[_. \\n]{5,}$|^(?:dash|dot| |\\n){5,}$)", flags: "i", args: ["Space", "Line feed"] - } - ]; + }, + { + pattern: "^(?=.*/)[-./ \n]{5,}$", + args: ["Space", "Forward slash"] + }, + { + pattern: "^(?=.*/)[_. /\n]{5,}$", + args: ["Space", "Forward slash"] + }, + { + pattern: "^(?=.*/)(?:dash|dot| |/|\n){5,}$", + flags: "i", + args: ["Space", "Forward slash"] + }]; } /**