mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +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) {
|
||||
const text = exports.paste_handler_converter(paste_html);
|
||||
const mdImageRegex = /^!\[.*]\(.*\)$/;
|
||||
if (text.match(mdImageRegex)) {
|
||||
if (mdImageRegex.test(text)) {
|
||||
// This block catches cases where we are pasting an
|
||||
// image into Zulip, which is handled by upload.js.
|
||||
return;
|
||||
|
||||
@@ -37,7 +37,7 @@ exports.highlight_with_escaping_and_regex = function (regex, item) {
|
||||
let result = "";
|
||||
|
||||
for (const piece of pieces) {
|
||||
if (piece.match(regex)) {
|
||||
if (regex.test(piece)) {
|
||||
result += "<strong>" + Handlebars.Utils.escapeExpression(piece) + "</strong>";
|
||||
} else {
|
||||
result += Handlebars.Utils.escapeExpression(piece);
|
||||
|
||||
Reference in New Issue
Block a user