diff options
author | Dave Mayo <dave_mayo@harvard.edu> | 2015-04-10 10:53:00 -0400 |
---|---|---|
committer | Dave Mayo <dave_mayo@harvard.edu> | 2015-04-10 10:53:00 -0400 |
commit | 69e97b001744d4e227384e5f3e8078b17ccf744c (patch) | |
tree | a91a47c945c568f471fbedf6d77497635467284e /src/html-abbrev.el | |
parent | 9324673829f97baacfd5db156a39c08903910ed5 (diff) | |
download | emmet-mode-69e97b001744d4e227384e5f3e8078b17ccf744c.tar.lz emmet-mode-69e97b001744d4e227384e5f3e8078b17ccf744c.tar.xz emmet-mode-69e97b001744d4e227384e5f3e8078b17ccf744c.zip |
Refs #61 - Escape using backslash inside { text }
This fixes half the problem specified in #61. The doc change
is technically inaccurate - opening brackets don't actually NEED to
be escaped - p{{\}} works as well as p{\{\}}. But they CAN be escaped,
so I used the most regular version.
The part that is NOT fixed is that a | character, escaped or not, will
prevent the expression from being parsed AT ALL.
Diffstat (limited to 'src/html-abbrev.el')
-rw-r--r-- | src/html-abbrev.el | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/html-abbrev.el b/src/html-abbrev.el index 0c3519b..961ee16 100644 --- a/src/html-abbrev.el +++ b/src/html-abbrev.el @@ -287,9 +287,12 @@ (defun emmet-text (input) "A zen coding expression innertext." - (emmet-parse "{\\(.*?\\)}" 2 "inner text" - (let ((txt (emmet-split-numbering-expressions (elt it 1)))) - `((text ,txt) . ,input)))) + (emmet-parse "{\\(\\(?:\\\\.\\|[^\\\\}]\\)*?\\)}" 2 "inner text" + (let ((txt (emmet-split-numbering-expressions (elt it 1)))) + (if (listp txt) + (setq txt (cons (car txt) (cons (replace-regexp-in-string "\\\\\\(.\\)" "\\1" (cadr txt)) (cddr txt)))) + (setq txt (replace-regexp-in-string "\\\\\\(.\\)" "\\1" txt))) + `((text ,txt) . ,input)))) (defun emmet-properties (input) "A bracketed emmet property expression." @@ -568,7 +571,7 @@ (if self-closing? "/>" (concat ">" (if tag-txt - (if block-indentation? + (if block-indentation? (emmet-indent tag-txt) tag-txt)) (if content |