FromMorse operation extended to treat dashes & hyphens as long signals

This commit is contained in:
misterRaven 2017-02-09 17:29:12 +07:00
parent 991bb887ae
commit 1cc7835a8d
1 changed files with 2 additions and 2 deletions

View File

@ -163,8 +163,8 @@ var MorseCode = {
var letterDelim = Utils.charRep[args[0]];
var wordDelim = Utils.charRep[args[1]];
input = input.replace(/-|_|dash/ig, "<dash>");
input = input.replace(/\.|dot/ig, "<dot>");
input = input.replace(/-|||_||—|dash/ig, "<dash>"); //hyphen-minus|hyphen|minus-sign|undersore|en-dash|em-dash
input = input.replace(/\.|·|dot/ig, "<dot>");
var words = input.split(wordDelim);
words = Array.prototype.map.call(words, function(word) {