mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
escape input before using it as a regex
This commit is contained in:
@@ -2,6 +2,7 @@ import { Box, createStyles, Mark, TypographyStylesProvider } from "@mantine/core
|
||||
import { Constants } from "app/constants"
|
||||
import { calculatePlaceholderSize } from "app/utils"
|
||||
import { ImageWithPlaceholderWhileLoading } from "components/ImageWithPlaceholderWhileLoading"
|
||||
import escapeStringRegexp from "escape-string-regexp"
|
||||
import { ChildrenNode, Interweave, Matcher, MatchResponse, Node, TransformCallback } from "interweave"
|
||||
import React from "react"
|
||||
|
||||
@@ -64,7 +65,7 @@ class HighlightMatcher extends Matcher {
|
||||
|
||||
constructor(search: string) {
|
||||
super("highlight")
|
||||
this.search = search
|
||||
this.search = escapeStringRegexp(search)
|
||||
}
|
||||
|
||||
match(string: string): MatchResponse<unknown> | null {
|
||||
|
||||
Reference in New Issue
Block a user