Skip to content

Commit

Permalink
option :id_delimiter replaced with :join_delimiter
Browse files Browse the repository at this point in the history
  • Loading branch information
minad committed Apr 27, 2011
1 parent e642fd4 commit 83365ab
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/slim/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Engine < Temple::Engine
set_default_options :pretty => false,
:attr_wrapper => '"',
:format => :html5,
:id_delimiter => nil,
:join_delimiter => {'class' => ' '},
:generator => Temple::Generators::ArrayBuffer

#
Expand All @@ -33,7 +33,7 @@ class Engine < Temple::Engine
# Boolean | :debug | false | Enable debug outputs (Temple internals)
# Symbol | :format | :html5 | HTML output format
# String | :attr_wrapper | '"' | Character to wrap attributes in html (can be ' or ")
# String | :id_delimiter | '_' | Joining character used if multiple html ids are supplied (e.g. #id1#id2)
# Hash | :join_delimiter | {'class' => ' '} | Joining character used if multiple html attributes are supplied (e.g. id1_id2)
# Boolean | :pretty | false | Pretty html indenting (This is slower!)
# Class | :generator | ArrayBuffer/RailsOutputBuffer | Temple code generator (default generator generates array buffer)
#
Expand Down Expand Up @@ -61,7 +61,7 @@ class Engine < Temple::Engine
use Slim::Compiler, :disable_capture, :auto_escape
filter :EscapeHTML, :use_html_safe
filter :Debugger, :debug, :debug_prefix => 'After Slim'
use Temple::HTML::Pretty, :format, :attr_wrapper, :id_delimiter, :pretty
use Temple::HTML::Pretty, :format, :attr_wrapper, :join_delimiter, :pretty
filter :MultiFlattener
filter :StaticMerger
filter :DynamicInliner
Expand Down
4 changes: 2 additions & 2 deletions test/slim/test_code_evaluation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,13 @@ def test_id_attribute_merging
source = %{
#alpha id="beta" Test it
}
assert_html '<div id="alpha_beta">Test it</div>', source, :id_delimiter => '_'
assert_html '<div id="alpha_beta">Test it</div>', source, :join_delimiter => {'class' => ' ', 'id' => '_' }
end

def test_id_attribute_merging2
source = %{
#alpha id="beta" Test it
}
assert_html '<div id="alpha-beta">Test it</div>', source, :id_delimiter => '-'
assert_html '<div id="alpha-beta">Test it</div>', source, :join_delimiter => {'class' => ' ', 'id' => '-' }
end
end
2 changes: 1 addition & 1 deletion test/slim/test_ruby_errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,6 @@ def test_id_attribute_merging2
source = %{
#alpha id="beta" Test it
}
assert_runtime_error 'Multiple id attributes specified, but id concatenation disabled', source
assert_runtime_error 'Multiple id attributes specified', source
end
end

0 comments on commit 83365ab

Please sign in to comment.