summaryrefslogtreecommitdiff
path: root/lisp/textmodes/css-mode.el
diff options
context:
space:
mode:
authorSimen Heggestøyl <simenheg@gmail.com>2016-01-14 19:24:03 +0100
committerSimen Heggestøyl <simenheg@gmail.com>2016-01-14 19:24:03 +0100
commitdadb841a06aa1ffd6d17c04ef83140dbd1ad7307 (patch)
tree33868efd29567b592826a8fa7b037aa4c6a56b51 /lisp/textmodes/css-mode.el
parentd5f1db83ecfffbbb52b88b382cf5d480e8a0ef32 (diff)
downloademacs-dadb841a06aa1ffd6d17c04ef83140dbd1ad7307.tar.gz
Disallow parenthesis in non-pseudo CSS selectors
* lisp/textmodes/css-mode.el (css--font-lock-keywords): Disallow parenthesis in selectors except for in the function notation that might appear right after a pseudo-class. * test/indent/scss-mode.scss: Add a test for it.
Diffstat (limited to 'lisp/textmodes/css-mode.el')
-rw-r--r--lisp/textmodes/css-mode.el10
1 files changed, 5 insertions, 5 deletions
diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el
index 48c24844a68..d402fb19955 100644
--- a/lisp/textmodes/css-mode.el
+++ b/lisp/textmodes/css-mode.el
@@ -257,13 +257,13 @@
(if (not sassy)
;; We don't allow / as first char, so as not to
;; take a comment as the beginning of a selector.
- "[^@/:{} \t\n][^:{}]+"
+ "[^@/:{}() \t\n][^:{}()]+"
;; Same as for non-sassy except we do want to allow { and }
;; chars in selectors in the case of #{$foo}
;; variable interpolation!
(concat "\\(?:" scss--hash-re
- "\\|[^@/:{} \t\n#]\\)"
- "[^:{}#]*\\(?:" scss--hash-re "[^:{}#]*\\)*"))
+ "\\|[^@/:{}() \t\n#]\\)"
+ "[^:{}()#]*\\(?:" scss--hash-re "[^:{}()#]*\\)*"))
;; Even though pseudo-elements should be prefixed by ::, a
;; single colon is accepted for backward compatibility.
"\\(?:\\(:" (regexp-opt (append css-pseudo-class-ids
@@ -271,8 +271,8 @@
"\\|\\::" (regexp-opt css-pseudo-element-ids t) "\\)"
"\\(?:([^)]+)\\)?"
(if (not sassy)
- "[^:{}\n]*"
- (concat "[^:{}\n#]*\\(?:" scss--hash-re "[^:{}\n#]*\\)*"))
+ "[^:{}()\n]*"
+ (concat "[^:{}()\n#]*\\(?:" scss--hash-re "[^:{}()\n#]*\\)*"))
"\\)*"
"\\)\\(?:\n[ \t]*\\)*{")
(1 'css-selector keep))