summaryrefslogtreecommitdiff
path: root/syntax.c
diff options
context:
space:
mode:
Diffstat (limited to 'syntax.c')
-rw-r--r--syntax.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/syntax.c b/syntax.c
index 87d83cd..fa539f1 100644
--- a/syntax.c
+++ b/syntax.c
@@ -1404,6 +1404,11 @@ static void syntax_highlight_javascript_like(
is_regex = false;
}
+ if (i + 1 < line_len && line[i+1] == '>') {
+ // slash is followed by equals, so this might be a self-closing JSX tag
+ is_regex = false;
+ }
+
if (is_regex) {
in_string = true;
string_is_regex = true;