diff options
Diffstat (limited to 'emmet-mode.el')
-rw-r--r-- | emmet-mode.el | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/emmet-mode.el b/emmet-mode.el index b06a8b6..b6a471b 100644 --- a/emmet-mode.el +++ b/emmet-mode.el @@ -3465,6 +3465,14 @@ tbl)) "Customization group for emmet-mode." :group 'convenience) +(defun emmet-check-for-markup (bound) + (save-excursion + (save-match-data + (goto-char (line-beginning-position)) + (if (re-search-forward "\\(\\([ \t]+\\)?<[^>]*?>\\)+" bound t) + t + nil)))) + (defun emmet-expr-on-line () "Extract a emmet expression and the corresponding bounds for the current line." @@ -3551,7 +3559,9 @@ For more information see `emmet-mode'." (if expr (let ((markup (emmet-transform (first expr)))) (when markup - (let ((pretty (emmet-prettify markup (current-indentation)))) + (let ((pretty (if (emmet-check-for-markup here) + markup + (emmet-prettify markup (current-indentation))))) (when pretty (delete-region (second expr) (third expr)) (emmet-insert-and-flash pretty) |