diff options
| author | Hunternif | 2021-08-04 03:29:02 +0100 |
|---|---|---|
| committer | Hunternif | 2021-08-04 03:29:02 +0100 |
| commit | c4874e2289c92879a059ee7e4a6fd7243039de1f (patch) | |
| tree | 84cdf71382bf7c6b51ef80cf1e543340227be235 /client/js/util | |
| parent | ca861cdc44ca476cec2949f237bbc7503862ad58 (diff) | |
| parent | 414106a4773d3a532e0903b6ee9524ca78c5e6ad (diff) | |
Merge branch 'master' into hunternif
Diffstat (limited to 'client/js/util')
| -rw-r--r-- | client/js/util/misc.js | 2 | ||||
| -rw-r--r-- | client/js/util/uri.js | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/client/js/util/misc.js b/client/js/util/misc.js index 4f9d6d3..756ad84 100644 --- a/client/js/util/misc.js +++ b/client/js/util/misc.js @@ -187,7 +187,7 @@ function arraysDiffer(source1, source2, orderImportant) { } function escapeSearchTerm(text) { - return text.replace(/([a-z_-]):/g, "$1\\:"); + return text.replace(/([a-z_-]):/g, "$1\\:").replace(/\./g, "\\."); } function dataURItoBlob(dataURI) { diff --git a/client/js/util/uri.js b/client/js/util/uri.js index c366912..172b8c8 100644 --- a/client/js/util/uri.js +++ b/client/js/util/uri.js @@ -95,15 +95,15 @@ function extractRootDomain(url) { return domain; } -function escapeColons(text) { - return text.replace(new RegExp(":", "g"), "\\:"); +function escapeTagName(text) { + return text.replace(/:/g, "\\:").replace(/\./g, "\\."); } module.exports = { getPostsQuery: getPostsQuery, formatClientLink: formatClientLink, formatApiLink: formatApiLink, - escapeColons: escapeColons, + escapeTagName: escapeTagName, escapeParam: escapeParam, unescapeParam: unescapeParam, extractHostname: extractHostname, |