Skip to content

Commit

Permalink
[issue #344] escape commas in clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
RealRaven2000 committed Jan 3, 2025
1 parent 54d995f commit 293d993
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions chrome/content/smartTemplate-overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -1440,8 +1440,9 @@ SmartTemplate4.parseModifier = function(msg, composeType, firstPass = false) {
util.clipboardWrite(replaceGroupString); // [issue 187]
if (!replaceGroupString) {
msg = msg.replace(matchPart[i], "");
} else {
msg = msg.replace(matchPart[i], `%toclipboard(${replaceGroupString})%`);// [issue 210]
} else {
let escapedGroupString = replaceGroupString.replaceAll(",", "\\,"); // [issue 344]
msg = msg.replace(matchPart[i], `%toclipboard(${escapedGroupString})%`); // [issue 210]
}
} else {
util.logDebug('matchTextParser(' + fromPart + ') - Replacing Pattern with:\n' + replaceGroupString);
Expand Down Expand Up @@ -2474,7 +2475,7 @@ SmartTemplate4.regularize = async function regularize(msg, composeType, isStatio
if (!util.hasLicense() || util.licenseInfo.keyType == 2) {
util.addUsedPremiumFunction("clipboard");
} else {
textParamList += util.clipboardRead("plain");
textParamList += util.clipboardRead("plain").replaceAll(",", "\,"); // [issue 344]
}
} else {
// for setting / prefixing or appending, concatenate all arguments to a single string
Expand Down Expand Up @@ -2968,6 +2969,7 @@ SmartTemplate4.regularize = async function regularize(msg, composeType, isStatio
attributes.set("removestyles", true);
break;
case "noquote":
// Future use
attributes.set("unquoteblock", true);
break;
}
Expand Down

0 comments on commit 293d993

Please sign in to comment.