mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Merge branch 'master' of /home/nex3/code/haml
This commit is contained in:
commit
ce9e6bf795
5 changed files with 47 additions and 2 deletions
2
Rakefile
2
Rakefile
|
@ -261,6 +261,8 @@ task :handle_update do
|
|||
begin
|
||||
if ENV["REF"] == "refs/heads/master"
|
||||
sh %{rake release_edge --trace}
|
||||
sh %{rake pages --trace PROJ=haml}
|
||||
sh %{rake pages --trace PROJ=sass}
|
||||
elsif ENV["REF"] =~ %r{^refs/heads/(haml|sass)-pages$}
|
||||
sh %{rake pages --trace PROJ=#{$1}}
|
||||
end
|
||||
|
|
8
TODO
8
TODO
|
@ -11,6 +11,14 @@
|
|||
** Haml
|
||||
Figure out alternate attribute syntax
|
||||
[2.4] Allow "!!! HTML5" to set :format => :html5 ?
|
||||
How do we deal with partials?
|
||||
[2.4] :ugly + :html improvements
|
||||
Ignore closing tags where we can
|
||||
http://code.google.com/speed/articles/optimizing-html.html
|
||||
Requires Haml parsing refactor
|
||||
Don't quote attributes that don't require it
|
||||
http://www.w3.org/TR/REC-html40/intro/sgmltut.html#h-3.2.2
|
||||
http://www.w3.org/TR/html5/syntax.html#attributes
|
||||
** Sass
|
||||
[2.4] CSS superset
|
||||
[2.4] Classes are mixins
|
||||
|
|
|
@ -15,7 +15,7 @@ module Haml
|
|||
# @param file [String] The filename relative to the Haml root
|
||||
# @return [String] The filename relative to the the working directory
|
||||
def scope(file)
|
||||
File.expand_path File.join(File.dirname(__FILE__), '..', '..', file)
|
||||
File.join(File.dirname(__FILE__), '..', '..', file)
|
||||
end
|
||||
|
||||
# Converts an array of `[key, value]` pairs to a hash.
|
||||
|
|
|
@ -118,7 +118,19 @@ module Sass
|
|||
#
|
||||
# @return [Tree::Node] The parsed rule
|
||||
def rule
|
||||
return unless rule = @template.scan(/[^\{\};]+/)
|
||||
rule = ""
|
||||
loop do
|
||||
token = @template.scan(/(?:[^\{\};\/\s]|\/[^*])+/)
|
||||
if token.nil?
|
||||
return if rule.empty?
|
||||
break
|
||||
end
|
||||
rule << token
|
||||
break unless @template.match?(/\s|\/\*/)
|
||||
whitespace
|
||||
rule << " "
|
||||
end
|
||||
|
||||
rule.strip!
|
||||
directive = rule[0] == ?@
|
||||
|
||||
|
|
|
@ -207,6 +207,29 @@ down_here { yeah: true; }
|
|||
CSS
|
||||
end
|
||||
|
||||
def test_comments_in_selectors
|
||||
assert_equal(<<SASS, css2sass(<<CSS))
|
||||
.js
|
||||
#location-navigation-form .form-submit, #business-listing-form .form-submit, #detailTabs ul, #detailsEnhanced #addTags, #locationSearchList, #moreHoods
|
||||
display: none
|
||||
|
||||
|
||||
#navListLeft
|
||||
display: none
|
||||
SASS
|
||||
.js #location-navigation-form .form-submit,
|
||||
.js #business-listing-form .form-submit,
|
||||
.js #detailTabs ul,
|
||||
/* .js #addReview, */
|
||||
/* .js #addTags, */
|
||||
.js #detailsEnhanced #addTags,
|
||||
.js #locationSearchList,
|
||||
.js #moreHoods,
|
||||
#navListLeft
|
||||
{ display: none; }
|
||||
CSS
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def css2sass(string, opts={})
|
||||
|
|
Loading…
Add table
Reference in a new issue