diff options
author | Emiliano Ciavatta | 2021-08-23 20:50:57 +0000 |
---|---|---|
committer | Emiliano Ciavatta | 2021-08-23 20:50:57 +0000 |
commit | 8491d5d9aedbb8855e261b9592df8a8ec81b0e5d (patch) | |
tree | 2be118fdf6e8ba257492c8ef174ab7cf60a2dc6e /frontend/src/components/panels | |
parent | dded53f3450b41b358674ea41e9f078fb0d4391f (diff) |
Fix rules highlighting in frontend
Diffstat (limited to 'frontend/src/components/panels')
-rw-r--r-- | frontend/src/components/panels/StreamsPane.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/frontend/src/components/panels/StreamsPane.js b/frontend/src/components/panels/StreamsPane.js index 8276949..82efd88 100644 --- a/frontend/src/components/panels/StreamsPane.js +++ b/frontend/src/components/panels/StreamsPane.js @@ -145,7 +145,7 @@ class StreamsPane extends Component { pattern["dot_all"] && (flags += "s"); pattern["multi_line"] && (flags += "m"); pattern["unicode_property"] && (flags += "u"); - const regex = new RegExp("(" + pattern.regex + ")", flags); + const regex = new RegExp(pattern.regex.replace(/^\//, '(').replace(/\/$/, ')'), flags); streamContent = reactStringReplace(streamContent, regex, (match, i) => ( <span key={i} className="matched-occurrence" style={{"backgroundColor": rule.color}}>{match}</span> )); |