temple 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/temple/html/pretty.rb +6 -1
- data/lib/temple/version.rb +1 -1
- data/test/html/test_pretty.rb +1 -1
- metadata +2 -2
data/lib/temple/html/pretty.rb
CHANGED
@@ -33,9 +33,14 @@ module Temple
|
|
33
33
|
if @pretty
|
34
34
|
@last = :noindent
|
35
35
|
tmp = unique_name
|
36
|
+
gsub_code = if ''.respond_to?(:html_safe?)
|
37
|
+
"#{tmp} = #{tmp}.html_safe? ? #{tmp}.gsub(\"\\n\", #{indent.inspect}).html_safe : #{tmp}.gsub(\"\\n\", #{indent.inspect})"
|
38
|
+
else
|
39
|
+
"#{tmp}.gsub!(\"\\n\", #{indent.inspect})"
|
40
|
+
end
|
36
41
|
[:multi,
|
37
42
|
[:code, "#{tmp} = (#{code}).to_s"],
|
38
|
-
[:code, "#{
|
43
|
+
[:code, "if #{@pre_tags_name} !~ #{tmp}; #{gsub_code}; end"],
|
39
44
|
[:dynamic, tmp]]
|
40
45
|
else
|
41
46
|
[:dynamic, code]
|
data/lib/temple/version.rb
CHANGED
data/test/html/test_pretty.rb
CHANGED
@@ -22,7 +22,7 @@ describe Temple::HTML::Pretty do
|
|
22
22
|
[:static, "text"],
|
23
23
|
[:multi,
|
24
24
|
[:code, "_temple_html_pretty2 = (code).to_s"],
|
25
|
-
[:code, '
|
25
|
+
[:code, 'if _temple_html_pretty1 !~ _temple_html_pretty2; _temple_html_pretty2.gsub!("\n", "\n "); end'],
|
26
26
|
[:dynamic, "_temple_html_pretty2"]]],
|
27
27
|
[:static, "</p>"]],
|
28
28
|
[:static, "\n</div>"]]]
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: temple
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.3.
|
5
|
+
version: 0.3.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Magnus Holm
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2011-06-
|
14
|
+
date: 2011-06-19 00:00:00 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: tilt
|