diff options
Diffstat (limited to 'zencoding-mode.el')
-rw-r--r-- | zencoding-mode.el | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/zencoding-mode.el b/zencoding-mode.el index 6625032..0924965 100644 --- a/zencoding-mode.el +++ b/zencoding-mode.el @@ -1545,13 +1545,13 @@ tbl)) (defun zencoding-css-split-args (exp) (zencoding-aif - (string-match "[#0-9$-]" exp) + (string-match "[ #0-9$-]" exp) (cons (substring exp 0 it) (substring exp it)) (list exp))) (defun zencoding-css-arg-number (input) (zencoding-parse - "\\(\\(?:-\\|\\)[0-9.]+\\)\\(\\(?:-\\|e\\|p\\|x\\)\\|\\)" 3 "css number arguments" + " *\\(\\(?:-\\|\\)[0-9.]+\\)\\(\\(?:-\\|e\\|p\\|x\\)\\|\\)" 3 "css number arguments" (cons (list (elt it 1) (let ((unit (string-to-char (elt it 2)))) (cond ((= unit ?-) "px") @@ -1563,7 +1563,7 @@ tbl)) (defun zencoding-css-arg-color (input) (zencoding-parse - "#\\([0-9a-fA-F]\\{1,6\\}\\)" 2 "css color argument" + " *#\\([0-9a-fA-F]\\{1,6\\}\\)" 2 "css color argument" (cons (let* ((n (elt it 1)) (l (length n))) (concat @@ -1578,12 +1578,18 @@ tbl)) 0 6))) input))) +(defun zencoding-css-arg-something (input) + (zencoding-parse + " *\\([^ ]+\\)" 2 "css argument" + (cons (elt it 1) input))) + (defun zencoding-css-parse-arg (input) (zencoding-run zencoding-css-arg-number it (zencoding-run zencoding-css-arg-color it - (if (equal input "") - it - (cons input ""))))) + (zencoding-run zencoding-css-arg-something it + (if (equal input "") + it + (cons input "")))))) (defun zencoding-css-important-p (input) (let ((len (length input))) @@ -1614,7 +1620,7 @@ tbl)) (let ((f (first i)) (s (second i))) (if f - (if (and s (or (string= s "") (string-match "^[#0-9$-]" s))) + (if (and s (or (string= s "") (string-match "^[ #0-9$-]" s))) (progn (setf rt (cons (concat f "+" s) rt)) (setf i (cddr i))) @@ -1715,7 +1721,6 @@ tbl)) exprs) "\n")) - (defun zencoding-css-transform (input) (zencoding-css-transform-exprs (zencoding-css-expr input)));;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Zencoding minor mode |