aboutsummaryrefslogtreecommitdiffstats
path: root/zencoding-mode.el
diff options
context:
space:
mode:
authorsmihica <smihica@gmail.com>2013-05-03 19:57:48 +0900
committersmihica <smihica@gmail.com>2013-05-03 19:57:48 +0900
commit60fa9d893bc9f4372dbb7563ba13a279e7d59212 (patch)
treea9a9c9a22e1d9b6466e0690e289d8898c7e3c894 /zencoding-mode.el
parent0436e4718eb91281be5ba39f84a68bed6761ed1c (diff)
downloademmet-mode-60fa9d893bc9f4372dbb7563ba13a279e7d59212.tar.lz
emmet-mode-60fa9d893bc9f4372dbb7563ba13a279e7d59212.tar.xz
emmet-mode-60fa9d893bc9f4372dbb7563ba13a279e7d59212.zip
Added #\Space division of css arguments.
Diffstat (limited to 'zencoding-mode.el')
-rw-r--r--zencoding-mode.el21
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