aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Dalziel <33435574+tomdl89@users.noreply.github.com>2022-01-18 23:01:04 +0100
committerGitHub <noreply@github.com>2022-01-18 23:01:04 +0100
commitbe97395e31861fa7b84e7440a87db455e2089107 (patch)
treed3b15daa53b1e1be9557439d3ee0291379f35987
parent11913ecee10063cd1f53ebb9f4b7ded1e413e83e (diff)
Allow parsing of js arrow fn `=>` in xml tags (#1573)
-rw-r--r--evil-common.el2
-rw-r--r--evil-tests.el11
2 files changed, 9 insertions, 4 deletions
diff --git a/evil-common.el b/evil-common.el
index 7c8b330..3bb67a1 100644
--- a/evil-common.el
+++ b/evil-common.el
@@ -1559,7 +1559,7 @@ last successful match (that caused COUNT to reach zero)."
(while
(and (setq match
(re-search-forward
- "<\\([^/ >\n]+\\)\\(?:[^\"/>]\\|\"[^\"]*\"\\)*?>\\|</\\([^>]+?\\)>"
+ "<\\([^/ >\n]+\\)\\(?:=>?\\|[^\"/>]\\|\"[^\"]*\"\\)*?>\\|</\\([^>]+?\\)>"
nil t dir))
(cond
((match-beginning op)
diff --git a/evil-tests.el b/evil-tests.el
index 8a5f4b1..a0c057e 100644
--- a/evil-tests.el
+++ b/evil-tests.el
@@ -6922,9 +6922,14 @@ test hello <a href=\"/deed.zh\">Creative Commons</a>
</p>[\n]}</div>
</body>
</html>
-"
-
- )))
+"))
+ (ert-info ("Handle js arrow fns")
+ (evil-test-buffer
+ :visual-start "«"
+ :visual-end "»"
+ "<button foo=\"bar\" onClick={() => fnbody()}>inner [t]ext</button>"
+ ("vit")
+ "<button foo=\"bar\" onClick={() => fnbody()}>«inner tex[t]»</button>")))
;;; Visual state