diff options
-rw-r--r-- | emmet-mode.el | 7 | ||||
-rw-r--r-- | src/mode-def.el | 7 | ||||
-rw-r--r-- | src/test.el | 5 |
3 files changed, 13 insertions, 6 deletions
diff --git a/emmet-mode.el b/emmet-mode.el index 92542f4..5f0a204 100644 --- a/emmet-mode.el +++ b/emmet-mode.el @@ -632,11 +632,12 @@ accept it or skip it." (to-wrap (if multi (split-string txt "\n") (list txt))) - (initial-elements (replace-regexp-in-string "\\(.*>\\)?[^>*]+\\*?$" "\\1" wrap-with t)) - (terminal-element (replace-regexp-in-string "\\(.*>\\)?\\([^>*]+\\)\\*?$" "\\2" wrap-with t)) + (initial-elements (replace-regexp-in-string "\\(.*\\(\\+\\|>\\)\\)?[^>*]+\\*?[[:digit:]]*$" "\\1" wrap-with t)) + (terminal-element (replace-regexp-in-string "\\(.*>\\)?\\([^>*]+\\)\\(\\*[[:digit:]]+$\\)?\\*?$" "\\2" wrap-with t)) + (multiplier-expr (replace-regexp-in-string "\\(.*>\\)?\\([^>*]+\\)\\(\\*[[:digit:]]+$\\)?\\*?$" "\\3" wrap-with t)) (expr (concat initial-elements - (mapconcat (lambda (el) (concat terminal-element "{!!!" (secure-hash 'sha1 el) "!!!}")) + (mapconcat (lambda (el) (concat terminal-element "{!!!" (secure-hash 'sha1 el) "!!!}" multiplier-expr)) to-wrap "+"))) (markup diff --git a/src/mode-def.el b/src/mode-def.el index 0f3a522..c0e3e2c 100644 --- a/src/mode-def.el +++ b/src/mode-def.el @@ -479,11 +479,12 @@ accept it or skip it." (to-wrap (if multi (split-string txt "\n") (list txt))) - (initial-elements (replace-regexp-in-string "\\(.*>\\)?[^>*]+\\*?$" "\\1" wrap-with t)) - (terminal-element (replace-regexp-in-string "\\(.*>\\)?\\([^>*]+\\)\\*?$" "\\2" wrap-with t)) + (initial-elements (replace-regexp-in-string "\\(.*\\(\\+\\|>\\)\\)?[^>*]+\\*?[[:digit:]]*$" "\\1" wrap-with t)) + (terminal-element (replace-regexp-in-string "\\(.*>\\)?\\([^>*]+\\)\\(\\*[[:digit:]]+$\\)?\\*?$" "\\2" wrap-with t)) + (multiplier-expr (replace-regexp-in-string "\\(.*>\\)?\\([^>*]+\\)\\(\\*[[:digit:]]+$\\)?\\*?$" "\\3" wrap-with t)) (expr (concat initial-elements - (mapconcat (lambda (el) (concat terminal-element "{!!!" (secure-hash 'sha1 el) "!!!}")) + (mapconcat (lambda (el) (concat terminal-element "{!!!" (secure-hash 'sha1 el) "!!!}" multiplier-expr)) to-wrap "+"))) (markup diff --git a/src/test.el b/src/test.el index 05f7a24..913daca 100644 --- a/src/test.el +++ b/src/test.el @@ -655,6 +655,11 @@ #'emmet-wrap-with-markup-test '((("div>ul>li" "I am some\nmultiline\n text") . "<div>\n <ul>\n <li>I am some\n multiline\n text</li>\n </ul>\n</div>"))) +(emmet-run-test-case "Wrap with per-line markup (trailing *)" + #'emmet-wrap-with-markup-test + '((("div>ul>li*" "I am some\nmultiline\n text") . + "<div>\n <ul>\n <li>I am some</li>\n <li>multiline</li>\n <li> text</li>\n </ul>\n</div>"))) + ;; Regression test for #54 (broken emmet-find-left-bound behavior ;; after tag with attributes) (defun emmet-regression-54-test (lis) |