From 163c3f51c124fc8578cb3728980fc3f8f802d870 Mon Sep 17 00:00:00 2001 From: Nathan Weizenbaum Date: Wed, 21 Oct 2009 13:49:57 -0700 Subject: [PATCH] [Sass] Support attribute selectors with spaces around the =. --- doc-src/SASS_CHANGELOG.md | 8 ++++++++ lib/sass/engine.rb | 2 +- test/sass/engine_test.rb | 11 +++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/doc-src/SASS_CHANGELOG.md b/doc-src/SASS_CHANGELOG.md index b9f30993..3e7c92f0 100644 --- a/doc-src/SASS_CHANGELOG.md +++ b/doc-src/SASS_CHANGELOG.md @@ -3,6 +3,14 @@ * Table of contents {:toc} +## 2.2.10 (Unreleased) + +* Add support for attribute selectors with spaces around the `=`. + For example: + + a[href = http://google.com] + color: blue + ## [2.2.9](http://github.com/nex3/haml/commit/2.2.9) There were no changes made to Sass between versions 2.2.8 and 2.2.9. diff --git a/lib/sass/engine.rb b/lib/sass/engine.rb index ca8d18f9..49acc513 100644 --- a/lib/sass/engine.rb +++ b/lib/sass/engine.rb @@ -107,7 +107,7 @@ module Sass MIXIN_INCLUDE_CHAR = ?+ # The regex that matches properties of the form name: prop. - PROPERTY_NEW_MATCHER = /^[^\s:"]+\s*[=:](\s|$)/ + PROPERTY_NEW_MATCHER = /^[^\s:"\[]+\s*[=:](\s|$)/ # The regex that matches and extracts data from # properties of the form name: prop. diff --git a/test/sass/engine_test.rb b/test/sass/engine_test.rb index e0335707..e1b2c9ea 100755 --- a/test/sass/engine_test.rb +++ b/test/sass/engine_test.rb @@ -673,6 +673,17 @@ foo { CSS end + def test_attribute_selector_with_spaces + assert_equal(<