mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 06:53:25 +00:00
eslint: Fix unicorn/prefer-regexp-test.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
a77120279d
commit
a679ee12f3
@@ -318,7 +318,7 @@ exports.paste_handler = function (event) {
|
|||||||
if (paste_html && page_params.development_environment) {
|
if (paste_html && page_params.development_environment) {
|
||||||
const text = exports.paste_handler_converter(paste_html);
|
const text = exports.paste_handler_converter(paste_html);
|
||||||
const mdImageRegex = /^!\[.*]\(.*\)$/;
|
const mdImageRegex = /^!\[.*]\(.*\)$/;
|
||||||
if (text.match(mdImageRegex)) {
|
if (mdImageRegex.test(text)) {
|
||||||
// This block catches cases where we are pasting an
|
// This block catches cases where we are pasting an
|
||||||
// image into Zulip, which is handled by upload.js.
|
// image into Zulip, which is handled by upload.js.
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ exports.highlight_with_escaping_and_regex = function (regex, item) {
|
|||||||
let result = "";
|
let result = "";
|
||||||
|
|
||||||
for (const piece of pieces) {
|
for (const piece of pieces) {
|
||||||
if (piece.match(regex)) {
|
if (regex.test(piece)) {
|
||||||
result += "<strong>" + Handlebars.Utils.escapeExpression(piece) + "</strong>";
|
result += "<strong>" + Handlebars.Utils.escapeExpression(piece) + "</strong>";
|
||||||
} else {
|
} else {
|
||||||
result += Handlebars.Utils.escapeExpression(piece);
|
result += Handlebars.Utils.escapeExpression(piece);
|
||||||
|
|||||||
Reference in New Issue
Block a user