diff options
author | silverwind <me@silverwind.io> | 2023-04-27 04:08:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-26 22:08:16 -0400 |
commit | 50133b02bd381b7ee4da1ec4b7b637d5b7552678 (patch) | |
tree | 88482ba6c25ed952fa4b84f7d92363ac231603ad /web_src/js | |
parent | cf465b472166ccf6d3e001e3043e4bf43e16e6b3 (diff) | |
download | gitea-50133b02bd381b7ee4da1ec4b7b637d5b7552678.tar.gz gitea-50133b02bd381b7ee4da1ec4b7b637d5b7552678.zip |
Add eslint-plugin-regexp (#24361)
Add
[`eslint-plugin-regexp`](https://github.com/ota-meshi/eslint-plugin-regexp)
and fix discovered issues. Config is mostly the recommended one, but I
relaxed a few rules.
Diffstat (limited to 'web_src/js')
-rw-r--r-- | web_src/js/features/codeeditor.js | 2 | ||||
-rw-r--r-- | web_src/js/utils.js | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/web_src/js/features/codeeditor.js b/web_src/js/features/codeeditor.js index 40bc6d618f..f003933262 100644 --- a/web_src/js/features/codeeditor.js +++ b/web_src/js/features/codeeditor.js @@ -136,7 +136,7 @@ function togglePreviewDisplay(previewable) { if (!previewTab) return; if (previewable) { - const newUrl = (previewTab.getAttribute('data-url') || '').replace(/(.*)\/.*/i, `$1/markup`); + const newUrl = (previewTab.getAttribute('data-url') || '').replace(/(.*)\/.*/, `$1/markup`); previewTab.setAttribute('data-url', newUrl); previewTab.style.display = ''; } else { diff --git a/web_src/js/utils.js b/web_src/js/utils.js index 8e15683908..25094deea2 100644 --- a/web_src/js/utils.js +++ b/web_src/js/utils.js @@ -32,7 +32,7 @@ export function isDarkTheme() { // strip <tags> from a string export function stripTags(text) { - return text.replace(/<[^>]*>?/gm, ''); + return text.replace(/<[^>]*>?/g, ''); } // searches the inclusive range [minValue, maxValue]. |