haml2html 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/haml2html/converter.rb +11 -2
- data/lib/haml2html/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b6e804a6e70b2ee7b505963c8fb1919067cf47502fc0598884d0ac6d288a42e5
|
|
4
|
+
data.tar.gz: 5bcc16b7b359cf436f07b55d15a5bb03d28821adcea468a4e7aebdabbe416126
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 47b3a2683f991ee10b879f3f46f8b4919c4794bd375cd95af16d7818449fbd62325a99863720ffe311c4b0e50db830a889ad6906f397b12772c4d12a10294b8d
|
|
7
|
+
data.tar.gz: f3836002ec40c1617aa98a24f0443d348d1951233f2472cd652ad5a6417887fff7cd53f237c64c5c96e69a72348846be4660b8210beec09ba318f72f53cc6db1
|
data/CHANGELOG.md
CHANGED
data/lib/haml2html/converter.rb
CHANGED
|
@@ -8,7 +8,7 @@ require_relative "diagnostic"
|
|
|
8
8
|
module Haml2html
|
|
9
9
|
class Converter
|
|
10
10
|
VOID_TAGS = %w[area base br col embed hr img input link meta param source track wbr].freeze
|
|
11
|
-
SUPPORTED_FILTERS = %w[plain escaped javascript css erb].freeze
|
|
11
|
+
SUPPORTED_FILTERS = %w[plain escaped javascript css erb ruby].freeze
|
|
12
12
|
|
|
13
13
|
attr_reader :diagnostics
|
|
14
14
|
|
|
@@ -113,7 +113,14 @@ module Haml2html
|
|
|
113
113
|
end
|
|
114
114
|
|
|
115
115
|
marker = raw_script_line?(node) ? "<%==" : "<%="
|
|
116
|
-
|
|
116
|
+
if node.children.any?
|
|
117
|
+
output = +"#{spaces(indent)}#{marker} #{code} %>\n"
|
|
118
|
+
output << emit_children(node.children, indent + 1)
|
|
119
|
+
output << "#{spaces(indent)}<% end %>\n" if closes_with_end?(node)
|
|
120
|
+
output
|
|
121
|
+
else
|
|
122
|
+
"#{spaces(indent)}#{marker} #{code} %>\n"
|
|
123
|
+
end
|
|
117
124
|
end
|
|
118
125
|
|
|
119
126
|
def emit_silent_script(node, indent)
|
|
@@ -164,6 +171,8 @@ module Haml2html
|
|
|
164
171
|
"#{spaces(indent)}<style>\n#{indent_block(text, indent + 1)}#{spaces(indent)}</style>\n"
|
|
165
172
|
when "erb"
|
|
166
173
|
indent_block(text, indent)
|
|
174
|
+
when "ruby"
|
|
175
|
+
"#{spaces(indent)}<%\n#{indent_block(text, indent)}#{spaces(indent)}%>\n"
|
|
167
176
|
end
|
|
168
177
|
end
|
|
169
178
|
|
data/lib/haml2html/version.rb
CHANGED