aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--emmet-mode.el19
-rw-r--r--src/mode-def.el19
2 files changed, 30 insertions, 8 deletions
diff --git a/emmet-mode.el b/emmet-mode.el
index 2380aea..b06a8b6 100644
--- a/emmet-mode.el
+++ b/emmet-mode.el
@@ -3470,10 +3470,21 @@ tbl))
for the current line."
(let* ((start (line-beginning-position))
(end (line-end-position))
- (line (buffer-substring-no-properties start end))
- (expr (emmet-regex "\\([ \t]*\\)\\([^\n]+\\)" line 2)))
- (if (first expr)
- (list (first expr) start end))))
+ (line (buffer-substring-no-properties start end)))
+ (save-excursion
+ (save-match-data
+ (let ((bound (point)))
+ (goto-char start)
+ (if (re-search-forward "\\(\\([ \t]+\\)?<[^>]*?>\\)+" bound t)
+ (progn
+ (setq start (match-end 0))
+ (setq end bound)
+ (setq line (buffer-substring-no-properties start end))
+ )
+ ))))
+ (let ((expr (emmet-regex "\\([ \t]*\\)\\([^\n]+\\)" line 2)))
+ (if (first expr)
+ (list (first expr) start end)))))
(defcustom emmet-indentation 4
"Number of spaces used for indentation."
diff --git a/src/mode-def.el b/src/mode-def.el
index fa01727..dd82409 100644
--- a/src/mode-def.el
+++ b/src/mode-def.el
@@ -10,10 +10,21 @@
for the current line."
(let* ((start (line-beginning-position))
(end (line-end-position))
- (line (buffer-substring-no-properties start end))
- (expr (emmet-regex "\\([ \t]*\\)\\([^\n]+\\)" line 2)))
- (if (first expr)
- (list (first expr) start end))))
+ (line (buffer-substring-no-properties start end)))
+ (save-excursion
+ (save-match-data
+ (let ((bound (point)))
+ (goto-char start)
+ (if (re-search-forward "\\(\\([ \t]+\\)?<[^>]*?>\\)+" bound t)
+ (progn
+ (setq start (match-end 0))
+ (setq end bound)
+ (setq line (buffer-substring-no-properties start end))
+ )
+ ))))
+ (let ((expr (emmet-regex "\\([ \t]*\\)\\([^\n]+\\)" line 2)))
+ (if (first expr)
+ (list (first expr) start end)))))
(defcustom emmet-indentation 4
"Number of spaces used for indentation."