Skip to content
Snippets Groups Projects
Commit 73275825 authored by Igor Markin's avatar Igor Markin
Browse files

Merge branch 'prune-qrcode-improvement' into 'master'

QR code trimming. Add support for spaces

See merge request light/clients/utils!40
parents c70c01ff 920ee616
No related branches found
No related tags found
1 merge request!40QR code trimming. Add support for spaces
......@@ -8,6 +8,6 @@ exports.removeSpacesAndLinebreaks = (s) => {
};
exports.removeQRCodes = (s) => {
return s
.replace(/\[qrcode.png\]<https:\/\/[\w./?=\-&]+>/g, "")
.replace(/<https:\/\/[\w./?=\-&]+>\[qrcode.png\]/g, "");
.replace(/\[qrcode.png\]\s*<https:\/\/[\w./?=\-&]+>/g, "")
.replace(/<https:\/\/[\w./?=\-&]+>\s*\[qrcode.png\]/g, "");
};
......@@ -7,6 +7,6 @@ export const removeSpacesAndLinebreaks = (s: string): string => {
export const removeQRCodes = (s: string): string => {
return s
.replace(/\[qrcode.png\]<https:\/\/[\w./?=\-&]+>/g, "")
.replace(/<https:\/\/[\w./?=\-&]+>\[qrcode.png\]/g, "");
.replace(/\[qrcode.png\]\s*<https:\/\/[\w./?=\-&]+>/g, "")
.replace(/<https:\/\/[\w./?=\-&]+>\s*\[qrcode.png\]/g, "");
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment