[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/web-mode 9f1701c029 2/2: block as attr value
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/web-mode 9f1701c029 2/2: block as attr value |
Date: |
Sun, 25 Dec 2022 07:59:54 -0500 (EST) |
branch: elpa/web-mode
commit 9f1701c029cfbdd4299efbda10bee6dcbb5e56af
Author: fxbois <fxbois@gmail.com>
Commit: fxbois <fxbois@gmail.com>
block as attr value
#1229
---
issues/1229.html.erb | 3 +++
web-mode.el | 6 ++++++
2 files changed, 9 insertions(+)
diff --git a/issues/1229.html.erb b/issues/1229.html.erb
new file mode 100644
index 0000000000..1a3aa25b19
--- /dev/null
+++ b/issues/1229.html.erb
@@ -0,0 +1,3 @@
+<input foo=<%= "bar " %> bar="baz" />
+<input foo=<%= "bar" %>
+ bar="baz" />
diff --git a/web-mode.el b/web-mode.el
index 0363073478..99a3e5b5b6 100644
--- a/web-mode.el
+++ b/web-mode.el
@@ -5598,6 +5598,7 @@ Also return non-nil if it is the command
`self-insert-command' is remapped to."
;; STATES: attr
;; (0)nil (1)space (2)name (3)space-before (4)equal (5)space-after
;; (6)value-uq (7)value-sq (8)value-dq (9)value-bq : jsx attr={}
+;; (10)value-block
(defun web-mode-attr-skip (limit)
@@ -5656,6 +5657,7 @@ Also return non-nil if it is the command
`self-insert-command' is remapped to."
((or (and (= state 8) (eq ?\" char) (not escaped))
(and (= state 7) (eq ?\' char) (not escaped))
(and (= state 9) (eq ?\} char) (= brace-depth 1))
+ (and (= state 10) (get-text-property pos 'block-end))
)
(setq attrs (+ attrs (web-mode-attr-scan pos state char name-beg
name-end val-beg attr-flags equal-offset tag-flags)))
(setq state 0
@@ -5666,6 +5668,10 @@ Also return non-nil if it is the command
`self-insert-command' is remapped to."
val-beg nil)
)
+ ((and (member state '(4 5)) (get-text-property pos 'block-beg))
+ (setq val-beg pos)
+ (setq state 10))
+
((and (member state '(4 5)) (member char '(?\' ?\" ?\{)))
(setq val-beg pos)
(setq quoted 1)