haml 3.2.0.alpha.10 → 3.2.0.alpha.13

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of haml might be problematic. Click here for more details.

Files changed (389) hide show
  1. data/.yardopts +19 -7
  2. data/CHANGELOG.md +1224 -0
  3. data/FAQ.md +157 -0
  4. data/README.md +99 -62
  5. data/REFERENCE.md +1404 -0
  6. data/Rakefile +52 -341
  7. data/init.rb +1 -18
  8. data/lib/haml.rb +6 -30
  9. data/lib/haml/buffer.rb +37 -16
  10. data/lib/haml/compiler.rb +52 -13
  11. data/lib/haml/engine.rb +61 -44
  12. data/lib/haml/exec.rb +21 -4
  13. data/lib/haml/filters.rb +136 -166
  14. data/lib/haml/helpers.rb +37 -10
  15. data/lib/haml/helpers/action_view_extensions.rb +2 -1
  16. data/lib/haml/helpers/action_view_mods.rb +67 -181
  17. data/lib/haml/helpers/rails_323_textarea_fix.rb +39 -0
  18. data/lib/haml/helpers/xss_mods.rb +9 -11
  19. data/lib/haml/html.rb +22 -9
  20. data/lib/haml/html/erb.rb +1 -1
  21. data/lib/haml/parser.rb +22 -15
  22. data/lib/haml/railtie.rb +2 -13
  23. data/lib/haml/template.rb +18 -85
  24. data/lib/haml/template/options.rb +1 -1
  25. data/lib/haml/template/plugin.rb +15 -101
  26. data/lib/haml/util.rb +120 -603
  27. data/lib/haml/version.rb +1 -107
  28. data/test/{haml/engine_test.rb → engine_test.rb} +137 -143
  29. data/test/{haml/erb → erb}/_av_partial_1.erb +1 -1
  30. data/test/{haml/erb → erb}/_av_partial_2.erb +1 -1
  31. data/test/{haml/erb → erb}/action_view.erb +1 -1
  32. data/test/{haml/erb → erb}/standard.erb +0 -0
  33. data/test/filters_test.rb +141 -0
  34. data/test/gemfiles/Gemfile.rails-3.0.x +4 -6
  35. data/test/gemfiles/Gemfile.rails-3.1.x +5 -6
  36. data/test/gemfiles/Gemfile.rails-3.2.x +6 -0
  37. data/test/haml-spec/LICENSE +14 -0
  38. data/test/{haml/spec → haml-spec}/README.md +26 -17
  39. data/test/haml-spec/lua_haml_spec.lua +38 -0
  40. data/test/haml-spec/perl_haml_test.pl +81 -0
  41. data/test/haml-spec/ruby_haml_test.rb +23 -0
  42. data/test/{haml/spec → haml-spec}/tests.json +132 -54
  43. data/test/{haml/helper_test.rb → helper_test.rb} +50 -36
  44. data/test/{haml/html2haml → html2haml}/erb_tests.rb +0 -0
  45. data/test/{haml/html2haml_test.rb → html2haml_test.rb} +11 -5
  46. data/test/{haml/markaby → markaby}/standard.mab +0 -0
  47. data/test/{haml/mocks → mocks}/article.rb +0 -0
  48. data/test/{haml/results → results}/content_for_layout.xhtml +0 -0
  49. data/test/{haml/results → results}/eval_suppressed.xhtml +0 -0
  50. data/test/{haml/results → results}/helpers.xhtml +0 -0
  51. data/test/{haml/results → results}/helpful.xhtml +0 -0
  52. data/test/{haml/results → results}/just_stuff.xhtml +0 -0
  53. data/test/{haml/results → results}/list.xhtml +0 -0
  54. data/test/{haml/results → results}/nuke_inner_whitespace.xhtml +0 -0
  55. data/test/{haml/results → results}/nuke_outer_whitespace.xhtml +0 -0
  56. data/test/{haml/results → results}/original_engine.xhtml +0 -0
  57. data/test/{haml/results → results}/partial_layout.xhtml +0 -0
  58. data/test/{haml/results → results}/partials.xhtml +0 -0
  59. data/test/{haml/results → results}/render_layout.xhtml +0 -0
  60. data/test/{haml/results → results}/silent_script.xhtml +1 -1
  61. data/test/{haml/results → results}/standard.xhtml +0 -0
  62. data/test/{haml/results → results}/tag_parsing.xhtml +0 -0
  63. data/test/{haml/results → results}/very_basic.xhtml +0 -0
  64. data/test/{haml/results → results}/whitespace_handling.xhtml +46 -50
  65. data/test/{haml/template_test.rb → template_test.rb} +20 -81
  66. data/test/{haml/templates → templates}/_av_partial_1.haml +1 -1
  67. data/test/{haml/templates → templates}/_av_partial_1_ugly.haml +1 -1
  68. data/test/{haml/templates → templates}/_av_partial_2.haml +1 -1
  69. data/test/{haml/templates → templates}/_av_partial_2_ugly.haml +1 -1
  70. data/test/{haml/templates → templates}/_layout.erb +0 -0
  71. data/test/{haml/templates → templates}/_layout_for_partial.haml +0 -0
  72. data/test/{haml/templates → templates}/_partial.haml +0 -0
  73. data/test/{haml/templates → templates}/_text_area.haml +0 -0
  74. data/test/{haml/templates → templates}/action_view.haml +1 -1
  75. data/test/{haml/templates → templates}/action_view_ugly.haml +1 -1
  76. data/test/{haml/templates → templates}/breakage.haml +0 -0
  77. data/test/{haml/templates → templates}/content_for_layout.haml +0 -0
  78. data/test/{haml/templates → templates}/eval_suppressed.haml +0 -0
  79. data/test/{haml/templates → templates}/helpers.haml +0 -0
  80. data/test/{haml/templates → templates}/helpful.haml +0 -0
  81. data/test/{haml/templates → templates}/just_stuff.haml +0 -0
  82. data/test/{haml/templates → templates}/list.haml +0 -0
  83. data/test/{haml/templates → templates}/nuke_inner_whitespace.haml +0 -0
  84. data/test/{haml/templates → templates}/nuke_outer_whitespace.haml +0 -0
  85. data/test/{haml/templates → templates}/original_engine.haml +0 -0
  86. data/test/templates/partial_layout.haml +3 -0
  87. data/test/{haml/templates → templates}/partialize.haml +0 -0
  88. data/test/{haml/templates → templates}/partials.haml +0 -0
  89. data/test/{haml/templates → templates}/render_layout.haml +0 -0
  90. data/test/{haml/templates → templates}/silent_script.haml +2 -2
  91. data/test/{haml/templates → templates}/standard.haml +0 -0
  92. data/test/{haml/templates → templates}/standard_ugly.haml +0 -0
  93. data/test/{haml/templates → templates}/tag_parsing.haml +0 -0
  94. data/test/{haml/templates → templates}/very_basic.haml +0 -0
  95. data/test/{haml/templates → templates}/whitespace_handling.haml +0 -0
  96. data/test/test_helper.rb +42 -34
  97. data/test/util_test.rb +80 -0
  98. metadata +259 -427
  99. data/CONTRIBUTING +0 -3
  100. data/REVISION +0 -1
  101. data/VERSION +0 -1
  102. data/VERSION_NAME +0 -1
  103. data/extra/update_watch.rb +0 -13
  104. data/lib/haml/root.rb +0 -7
  105. data/lib/haml/shared.rb +0 -78
  106. data/lib/haml/template/patch.rb +0 -58
  107. data/lib/sass.rb +0 -8
  108. data/lib/sass/plugin.rb +0 -10
  109. data/lib/sass/rails2_shim.rb +0 -9
  110. data/lib/sass/rails3_shim.rb +0 -16
  111. data/test/benchmark.rb +0 -91
  112. data/test/gemfiles/Gemfile.rails-2.0.x +0 -8
  113. data/test/gemfiles/Gemfile.rails-2.0.x.lock +0 -38
  114. data/test/gemfiles/Gemfile.rails-2.1.x +0 -8
  115. data/test/gemfiles/Gemfile.rails-2.1.x.lock +0 -38
  116. data/test/gemfiles/Gemfile.rails-2.2.x +0 -8
  117. data/test/gemfiles/Gemfile.rails-2.2.x.lock +0 -38
  118. data/test/gemfiles/Gemfile.rails-2.3.x +0 -8
  119. data/test/gemfiles/Gemfile.rails-2.3.x.lock +0 -40
  120. data/test/gemfiles/Gemfile.rails-3.0.x.lock +0 -85
  121. data/test/gemfiles/Gemfile.rails-3.1.x.lock +0 -98
  122. data/test/gemfiles/Gemfile.rails-xss-2.3.x +0 -9
  123. data/test/gemfiles/Gemfile.rails-xss-2.3.x.lock +0 -42
  124. data/test/haml/results/filters.xhtml +0 -62
  125. data/test/haml/spec/lua_haml_spec.lua +0 -30
  126. data/test/haml/spec/ruby_haml_test.rb +0 -19
  127. data/test/haml/spec_test.rb +0 -44
  128. data/test/haml/templates/filters.haml +0 -66
  129. data/test/haml/templates/partial_layout.haml +0 -10
  130. data/test/haml/util_test.rb +0 -300
  131. data/test/linked_rails.rb +0 -42
  132. data/vendor/sass/CONTRIBUTING +0 -3
  133. data/vendor/sass/MIT-LICENSE +0 -20
  134. data/vendor/sass/README.md +0 -201
  135. data/vendor/sass/Rakefile +0 -339
  136. data/vendor/sass/TODO +0 -39
  137. data/vendor/sass/VERSION +0 -1
  138. data/vendor/sass/VERSION_NAME +0 -1
  139. data/vendor/sass/bin/sass +0 -8
  140. data/vendor/sass/bin/sass-convert +0 -7
  141. data/vendor/sass/bin/scss +0 -8
  142. data/vendor/sass/doc-src/FAQ.md +0 -35
  143. data/vendor/sass/doc-src/INDENTED_SYNTAX.md +0 -210
  144. data/vendor/sass/doc-src/SASS_CHANGELOG.md +0 -2327
  145. data/vendor/sass/doc-src/SASS_REFERENCE.md +0 -1965
  146. data/vendor/sass/doc-src/SCSS_FOR_SASS_USERS.md +0 -155
  147. data/vendor/sass/ext/extconf.rb +0 -10
  148. data/vendor/sass/extra/update_watch.rb +0 -13
  149. data/vendor/sass/init.rb +0 -18
  150. data/vendor/sass/lib/sass.rb +0 -73
  151. data/vendor/sass/lib/sass/cache_stores.rb +0 -15
  152. data/vendor/sass/lib/sass/cache_stores/base.rb +0 -86
  153. data/vendor/sass/lib/sass/cache_stores/chain.rb +0 -33
  154. data/vendor/sass/lib/sass/cache_stores/filesystem.rb +0 -60
  155. data/vendor/sass/lib/sass/cache_stores/memory.rb +0 -47
  156. data/vendor/sass/lib/sass/cache_stores/null.rb +0 -25
  157. data/vendor/sass/lib/sass/callbacks.rb +0 -66
  158. data/vendor/sass/lib/sass/css.rb +0 -295
  159. data/vendor/sass/lib/sass/engine.rb +0 -878
  160. data/vendor/sass/lib/sass/environment.rb +0 -166
  161. data/vendor/sass/lib/sass/error.rb +0 -201
  162. data/vendor/sass/lib/sass/exec.rb +0 -672
  163. data/vendor/sass/lib/sass/importers.rb +0 -22
  164. data/vendor/sass/lib/sass/importers/base.rb +0 -139
  165. data/vendor/sass/lib/sass/importers/filesystem.rb +0 -149
  166. data/vendor/sass/lib/sass/less.rb +0 -382
  167. data/vendor/sass/lib/sass/logger.rb +0 -15
  168. data/vendor/sass/lib/sass/logger/base.rb +0 -32
  169. data/vendor/sass/lib/sass/logger/log_level.rb +0 -49
  170. data/vendor/sass/lib/sass/plugin.rb +0 -132
  171. data/vendor/sass/lib/sass/plugin/compiler.rb +0 -383
  172. data/vendor/sass/lib/sass/plugin/configuration.rb +0 -123
  173. data/vendor/sass/lib/sass/plugin/generic.rb +0 -15
  174. data/vendor/sass/lib/sass/plugin/merb.rb +0 -48
  175. data/vendor/sass/lib/sass/plugin/rack.rb +0 -60
  176. data/vendor/sass/lib/sass/plugin/rails.rb +0 -47
  177. data/vendor/sass/lib/sass/plugin/staleness_checker.rb +0 -173
  178. data/vendor/sass/lib/sass/railtie.rb +0 -9
  179. data/vendor/sass/lib/sass/repl.rb +0 -58
  180. data/vendor/sass/lib/sass/root.rb +0 -7
  181. data/vendor/sass/lib/sass/script.rb +0 -40
  182. data/vendor/sass/lib/sass/script/bool.rb +0 -18
  183. data/vendor/sass/lib/sass/script/color.rb +0 -480
  184. data/vendor/sass/lib/sass/script/css_lexer.rb +0 -29
  185. data/vendor/sass/lib/sass/script/css_parser.rb +0 -31
  186. data/vendor/sass/lib/sass/script/funcall.rb +0 -175
  187. data/vendor/sass/lib/sass/script/functions.rb +0 -1386
  188. data/vendor/sass/lib/sass/script/interpolation.rb +0 -79
  189. data/vendor/sass/lib/sass/script/lexer.rb +0 -339
  190. data/vendor/sass/lib/sass/script/list.rb +0 -83
  191. data/vendor/sass/lib/sass/script/literal.rb +0 -250
  192. data/vendor/sass/lib/sass/script/node.rb +0 -99
  193. data/vendor/sass/lib/sass/script/number.rb +0 -452
  194. data/vendor/sass/lib/sass/script/operation.rb +0 -99
  195. data/vendor/sass/lib/sass/script/parser.rb +0 -474
  196. data/vendor/sass/lib/sass/script/string.rb +0 -51
  197. data/vendor/sass/lib/sass/script/string_interpolation.rb +0 -103
  198. data/vendor/sass/lib/sass/script/unary_operation.rb +0 -64
  199. data/vendor/sass/lib/sass/script/variable.rb +0 -59
  200. data/vendor/sass/lib/sass/scss.rb +0 -17
  201. data/vendor/sass/lib/sass/scss/css_parser.rb +0 -46
  202. data/vendor/sass/lib/sass/scss/parser.rb +0 -960
  203. data/vendor/sass/lib/sass/scss/rx.rb +0 -128
  204. data/vendor/sass/lib/sass/scss/sass_parser.rb +0 -11
  205. data/vendor/sass/lib/sass/scss/script_lexer.rb +0 -15
  206. data/vendor/sass/lib/sass/scss/script_parser.rb +0 -25
  207. data/vendor/sass/lib/sass/scss/static_parser.rb +0 -40
  208. data/vendor/sass/lib/sass/selector.rb +0 -361
  209. data/vendor/sass/lib/sass/selector/abstract_sequence.rb +0 -62
  210. data/vendor/sass/lib/sass/selector/comma_sequence.rb +0 -81
  211. data/vendor/sass/lib/sass/selector/sequence.rb +0 -233
  212. data/vendor/sass/lib/sass/selector/simple.rb +0 -113
  213. data/vendor/sass/lib/sass/selector/simple_sequence.rb +0 -134
  214. data/vendor/sass/lib/sass/shared.rb +0 -78
  215. data/vendor/sass/lib/sass/tree/charset_node.rb +0 -22
  216. data/vendor/sass/lib/sass/tree/comment_node.rb +0 -90
  217. data/vendor/sass/lib/sass/tree/debug_node.rb +0 -18
  218. data/vendor/sass/lib/sass/tree/directive_node.rb +0 -23
  219. data/vendor/sass/lib/sass/tree/each_node.rb +0 -24
  220. data/vendor/sass/lib/sass/tree/extend_node.rb +0 -29
  221. data/vendor/sass/lib/sass/tree/for_node.rb +0 -36
  222. data/vendor/sass/lib/sass/tree/function_node.rb +0 -27
  223. data/vendor/sass/lib/sass/tree/if_node.rb +0 -52
  224. data/vendor/sass/lib/sass/tree/import_node.rb +0 -68
  225. data/vendor/sass/lib/sass/tree/media_node.rb +0 -32
  226. data/vendor/sass/lib/sass/tree/mixin_def_node.rb +0 -27
  227. data/vendor/sass/lib/sass/tree/mixin_node.rb +0 -32
  228. data/vendor/sass/lib/sass/tree/node.rb +0 -201
  229. data/vendor/sass/lib/sass/tree/prop_node.rb +0 -148
  230. data/vendor/sass/lib/sass/tree/return_node.rb +0 -18
  231. data/vendor/sass/lib/sass/tree/root_node.rb +0 -28
  232. data/vendor/sass/lib/sass/tree/rule_node.rb +0 -136
  233. data/vendor/sass/lib/sass/tree/variable_node.rb +0 -30
  234. data/vendor/sass/lib/sass/tree/visitors/base.rb +0 -75
  235. data/vendor/sass/lib/sass/tree/visitors/check_nesting.rb +0 -133
  236. data/vendor/sass/lib/sass/tree/visitors/convert.rb +0 -260
  237. data/vendor/sass/lib/sass/tree/visitors/cssize.rb +0 -175
  238. data/vendor/sass/lib/sass/tree/visitors/deep_copy.rb +0 -87
  239. data/vendor/sass/lib/sass/tree/visitors/perform.rb +0 -332
  240. data/vendor/sass/lib/sass/tree/visitors/set_options.rb +0 -97
  241. data/vendor/sass/lib/sass/tree/visitors/to_css.rb +0 -210
  242. data/vendor/sass/lib/sass/tree/warn_node.rb +0 -18
  243. data/vendor/sass/lib/sass/tree/while_node.rb +0 -18
  244. data/vendor/sass/lib/sass/util.rb +0 -721
  245. data/vendor/sass/lib/sass/util/subset_map.rb +0 -101
  246. data/vendor/sass/lib/sass/version.rb +0 -112
  247. data/vendor/sass/rails/init.rb +0 -1
  248. data/vendor/sass/sass.gemspec +0 -33
  249. data/vendor/sass/test/Gemfile +0 -4
  250. data/vendor/sass/test/Gemfile.lock +0 -19
  251. data/vendor/sass/test/sass/cache_test.rb +0 -89
  252. data/vendor/sass/test/sass/callbacks_test.rb +0 -61
  253. data/vendor/sass/test/sass/conversion_test.rb +0 -1199
  254. data/vendor/sass/test/sass/css2sass_test.rb +0 -373
  255. data/vendor/sass/test/sass/data/hsl-rgb.txt +0 -319
  256. data/vendor/sass/test/sass/engine_test.rb +0 -2567
  257. data/vendor/sass/test/sass/extend_test.rb +0 -1348
  258. data/vendor/sass/test/sass/fixtures/test_staleness_check_across_importers.css +0 -1
  259. data/vendor/sass/test/sass/fixtures/test_staleness_check_across_importers.scss +0 -1
  260. data/vendor/sass/test/sass/functions_test.rb +0 -1038
  261. data/vendor/sass/test/sass/importer_test.rb +0 -192
  262. data/vendor/sass/test/sass/less_conversion_test.rb +0 -653
  263. data/vendor/sass/test/sass/logger_test.rb +0 -58
  264. data/vendor/sass/test/sass/mock_importer.rb +0 -49
  265. data/vendor/sass/test/sass/more_results/more1.css +0 -9
  266. data/vendor/sass/test/sass/more_results/more1_with_line_comments.css +0 -26
  267. data/vendor/sass/test/sass/more_results/more_import.css +0 -29
  268. data/vendor/sass/test/sass/more_templates/_more_partial.sass +0 -2
  269. data/vendor/sass/test/sass/more_templates/more1.sass +0 -23
  270. data/vendor/sass/test/sass/more_templates/more_import.sass +0 -11
  271. data/vendor/sass/test/sass/plugin_test.rb +0 -472
  272. data/vendor/sass/test/sass/results/alt.css +0 -4
  273. data/vendor/sass/test/sass/results/basic.css +0 -9
  274. data/vendor/sass/test/sass/results/compact.css +0 -5
  275. data/vendor/sass/test/sass/results/complex.css +0 -86
  276. data/vendor/sass/test/sass/results/compressed.css +0 -1
  277. data/vendor/sass/test/sass/results/expanded.css +0 -19
  278. data/vendor/sass/test/sass/results/if.css +0 -3
  279. data/vendor/sass/test/sass/results/import.css +0 -31
  280. data/vendor/sass/test/sass/results/import_charset.css +0 -4
  281. data/vendor/sass/test/sass/results/import_charset_1_8.css +0 -4
  282. data/vendor/sass/test/sass/results/import_charset_ibm866.css +0 -4
  283. data/vendor/sass/test/sass/results/line_numbers.css +0 -49
  284. data/vendor/sass/test/sass/results/mixins.css +0 -95
  285. data/vendor/sass/test/sass/results/multiline.css +0 -24
  286. data/vendor/sass/test/sass/results/nested.css +0 -22
  287. data/vendor/sass/test/sass/results/options.css +0 -1
  288. data/vendor/sass/test/sass/results/parent_ref.css +0 -13
  289. data/vendor/sass/test/sass/results/script.css +0 -16
  290. data/vendor/sass/test/sass/results/scss_import.css +0 -31
  291. data/vendor/sass/test/sass/results/scss_importee.css +0 -2
  292. data/vendor/sass/test/sass/results/subdir/nested_subdir/nested_subdir.css +0 -1
  293. data/vendor/sass/test/sass/results/subdir/subdir.css +0 -3
  294. data/vendor/sass/test/sass/results/units.css +0 -11
  295. data/vendor/sass/test/sass/results/warn.css +0 -0
  296. data/vendor/sass/test/sass/results/warn_imported.css +0 -0
  297. data/vendor/sass/test/sass/script_conversion_test.rb +0 -285
  298. data/vendor/sass/test/sass/script_test.rb +0 -514
  299. data/vendor/sass/test/sass/scss/css_test.rb +0 -922
  300. data/vendor/sass/test/sass/scss/rx_test.rb +0 -156
  301. data/vendor/sass/test/sass/scss/scss_test.rb +0 -1273
  302. data/vendor/sass/test/sass/scss/test_helper.rb +0 -37
  303. data/vendor/sass/test/sass/templates/_imported_charset_ibm866.sass +0 -4
  304. data/vendor/sass/test/sass/templates/_imported_charset_utf8.sass +0 -4
  305. data/vendor/sass/test/sass/templates/_partial.sass +0 -2
  306. data/vendor/sass/test/sass/templates/alt.sass +0 -16
  307. data/vendor/sass/test/sass/templates/basic.sass +0 -23
  308. data/vendor/sass/test/sass/templates/bork1.sass +0 -2
  309. data/vendor/sass/test/sass/templates/bork2.sass +0 -2
  310. data/vendor/sass/test/sass/templates/bork3.sass +0 -2
  311. data/vendor/sass/test/sass/templates/bork4.sass +0 -2
  312. data/vendor/sass/test/sass/templates/bork5.sass +0 -3
  313. data/vendor/sass/test/sass/templates/compact.sass +0 -17
  314. data/vendor/sass/test/sass/templates/complex.sass +0 -305
  315. data/vendor/sass/test/sass/templates/compressed.sass +0 -15
  316. data/vendor/sass/test/sass/templates/expanded.sass +0 -17
  317. data/vendor/sass/test/sass/templates/if.sass +0 -11
  318. data/vendor/sass/test/sass/templates/import.sass +0 -12
  319. data/vendor/sass/test/sass/templates/import_charset.sass +0 -7
  320. data/vendor/sass/test/sass/templates/import_charset_1_8.sass +0 -4
  321. data/vendor/sass/test/sass/templates/import_charset_ibm866.sass +0 -9
  322. data/vendor/sass/test/sass/templates/importee.less +0 -2
  323. data/vendor/sass/test/sass/templates/importee.sass +0 -19
  324. data/vendor/sass/test/sass/templates/line_numbers.sass +0 -13
  325. data/vendor/sass/test/sass/templates/mixin_bork.sass +0 -5
  326. data/vendor/sass/test/sass/templates/mixins.sass +0 -76
  327. data/vendor/sass/test/sass/templates/multiline.sass +0 -20
  328. data/vendor/sass/test/sass/templates/nested.sass +0 -25
  329. data/vendor/sass/test/sass/templates/nested_bork1.sass +0 -2
  330. data/vendor/sass/test/sass/templates/nested_bork2.sass +0 -2
  331. data/vendor/sass/test/sass/templates/nested_bork3.sass +0 -2
  332. data/vendor/sass/test/sass/templates/nested_bork4.sass +0 -2
  333. data/vendor/sass/test/sass/templates/nested_bork5.sass +0 -2
  334. data/vendor/sass/test/sass/templates/nested_import.sass +0 -2
  335. data/vendor/sass/test/sass/templates/nested_mixin_bork.sass +0 -6
  336. data/vendor/sass/test/sass/templates/options.sass +0 -2
  337. data/vendor/sass/test/sass/templates/parent_ref.sass +0 -25
  338. data/vendor/sass/test/sass/templates/script.sass +0 -101
  339. data/vendor/sass/test/sass/templates/scss_import.scss +0 -11
  340. data/vendor/sass/test/sass/templates/scss_importee.scss +0 -1
  341. data/vendor/sass/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +0 -2
  342. data/vendor/sass/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +0 -3
  343. data/vendor/sass/test/sass/templates/subdir/subdir.sass +0 -6
  344. data/vendor/sass/test/sass/templates/units.sass +0 -11
  345. data/vendor/sass/test/sass/templates/warn.sass +0 -3
  346. data/vendor/sass/test/sass/templates/warn_imported.sass +0 -4
  347. data/vendor/sass/test/sass/test_helper.rb +0 -8
  348. data/vendor/sass/test/sass/util/subset_map_test.rb +0 -91
  349. data/vendor/sass/test/sass/util_test.rb +0 -266
  350. data/vendor/sass/test/test_helper.rb +0 -69
  351. data/vendor/sass/vendor/fssm/Gemfile +0 -3
  352. data/vendor/sass/vendor/fssm/LICENSE +0 -20
  353. data/vendor/sass/vendor/fssm/README.markdown +0 -83
  354. data/vendor/sass/vendor/fssm/Rakefile +0 -11
  355. data/vendor/sass/vendor/fssm/example.rb +0 -12
  356. data/vendor/sass/vendor/fssm/fssm.gemspec +0 -24
  357. data/vendor/sass/vendor/fssm/lib/fssm.rb +0 -37
  358. data/vendor/sass/vendor/fssm/lib/fssm/backends/fsevents.rb +0 -36
  359. data/vendor/sass/vendor/fssm/lib/fssm/backends/inotify.rb +0 -26
  360. data/vendor/sass/vendor/fssm/lib/fssm/backends/polling.rb +0 -25
  361. data/vendor/sass/vendor/fssm/lib/fssm/backends/rbfsevent.rb +0 -42
  362. data/vendor/sass/vendor/fssm/lib/fssm/backends/rubycocoa/fsevents.rb +0 -131
  363. data/vendor/sass/vendor/fssm/lib/fssm/monitor.rb +0 -36
  364. data/vendor/sass/vendor/fssm/lib/fssm/path.rb +0 -94
  365. data/vendor/sass/vendor/fssm/lib/fssm/pathname.rb +0 -36
  366. data/vendor/sass/vendor/fssm/lib/fssm/state/directory.rb +0 -75
  367. data/vendor/sass/vendor/fssm/lib/fssm/state/file.rb +0 -24
  368. data/vendor/sass/vendor/fssm/lib/fssm/support.rb +0 -92
  369. data/vendor/sass/vendor/fssm/lib/fssm/tree.rb +0 -176
  370. data/vendor/sass/vendor/fssm/lib/fssm/version.rb +0 -3
  371. data/vendor/sass/vendor/fssm/profile/prof-cache.rb +0 -40
  372. data/vendor/sass/vendor/fssm/profile/prof-fssm-pathname.html +0 -1231
  373. data/vendor/sass/vendor/fssm/profile/prof-pathname-rubinius.rb +0 -35
  374. data/vendor/sass/vendor/fssm/profile/prof-pathname.rb +0 -68
  375. data/vendor/sass/vendor/fssm/profile/prof-plain-pathname.html +0 -988
  376. data/vendor/sass/vendor/fssm/profile/prof.html +0 -2379
  377. data/vendor/sass/vendor/fssm/spec/count_down_latch.rb +0 -151
  378. data/vendor/sass/vendor/fssm/spec/monitor_spec.rb +0 -202
  379. data/vendor/sass/vendor/fssm/spec/path_spec.rb +0 -96
  380. data/vendor/sass/vendor/fssm/spec/root/duck/quack.txt +0 -0
  381. data/vendor/sass/vendor/fssm/spec/root/file.css +0 -0
  382. data/vendor/sass/vendor/fssm/spec/root/file.rb +0 -0
  383. data/vendor/sass/vendor/fssm/spec/root/file.yml +0 -0
  384. data/vendor/sass/vendor/fssm/spec/root/moo/cow.txt +0 -0
  385. data/vendor/sass/vendor/fssm/spec/spec_helper.rb +0 -14
  386. data/vendor/sass/yard/callbacks.rb +0 -29
  387. data/vendor/sass/yard/default/fulldoc/html/css/common.sass +0 -26
  388. data/vendor/sass/yard/default/layout/html/footer.erb +0 -12
  389. data/vendor/sass/yard/inherited_hash.rb +0 -41
data/.yardopts CHANGED
@@ -1,11 +1,23 @@
1
- --readme README.md
2
- --markup markdown
3
- --markup-provider maruku
4
- --default-return ""
5
- --title "Haml Documentation"
6
- --query 'object.type != :classvariable'
7
- --query 'object.type != :constant || @api && @api.text == "public"'
1
+ --charset utf-8
2
+ --readme README.md
3
+ --markup markdown
4
+ --markup-provider maruku
5
+ --template-path yard
6
+ --default-return ""
7
+ --title "Haml Documentation"
8
+ --query 'object.type != :classvariable'
9
+ --query 'object.type != :constant || @api && @api.text == "public"'
10
+ --exclude lib/haml/template/patch.rb
11
+ --exclude lib/haml/template/plugin.rb
12
+ --exclude lib/haml/railtie.rb
13
+ --exclude lib/haml/helpers/action_view_mods.rb
14
+ --exclude lib/haml/helpers/xss_mods.rb
8
15
  --hide-void-return
9
16
  --protected
10
17
  --no-private
11
18
  --no-highlight
19
+ -
20
+ FAQ.md
21
+ CHANGELOG.md
22
+ REFERENCE.md
23
+ MIT-LICENSE
@@ -0,0 +1,1224 @@
1
+ # Haml Changelog
2
+
3
+ ## 3.2.0 (Unreleased)
4
+
5
+ * Haml now flattens deeply nested data attribute hashes. For example:
6
+
7
+ `.foo{:data => {:a => "b", :c => {:d => "e", :f => "g"}}}`
8
+
9
+ would render to:
10
+
11
+ `<div class='foo' data-a='b' data-c-d='e' data-c-f='g'></div>`
12
+
13
+ (thanks to [Péter Pál Koszta](https://github.com/koszta))
14
+
15
+ * Filters that rely on third-party template engines are now implemented using
16
+ [Tilt](github.com/rtomayko/tilt). Several new filters have been added, namely
17
+ SCSS (:scss), LessCSS, (:less), and Coffeescript (:coffee/:coffeescript).
18
+
19
+ Though the list of "official" filters is kept intentionally small, Haml comes
20
+ with a helper method that makes adding support for other Tilt-based template
21
+ engines trivial.
22
+
23
+ As of 3.2, Haml will also ship with a "haml-contrib" gem that includes useful
24
+ but less-frequently used filters and helpers. This includes several additional
25
+ filters such as Nokogiri, Yajl, Markaby, and others.
26
+
27
+ * Generate object references based on `#to_key` if it exists in preference to
28
+ `#id`.
29
+
30
+ * Performance improvements.
31
+ (thanks to [Chris Heald](https://github.com/cheald))
32
+
33
+ * Add an {file:REFERENCE.md#hyphenate_data_attrs-option `:hyphenate_data_attrs`
34
+ option} that converts underscores to hyphens in your HTML5 data keys. This is
35
+ a language change from 3.1 and is enabled by default.
36
+ (thanks to [Andrew Smith](https://github.com/fullsailor))
37
+
38
+ * Helper `list_of` takes an extra argument that is rendered into list item
39
+ attributes.
40
+ (thanks [Iain Barnett](http://iainbarnett.me.uk/))
41
+
42
+ * Fix parser to allow lines ending with `some_method?` to be a Ruby multinline.
43
+ (thanks to [Brad Ediger](https://github.com/bradediger))
44
+
45
+ * Always use :xhtml format when the mime_type of the rendered template is
46
+ 'text/xml'.
47
+ (thanks to [Stephen Bannasch](https://github.com/stepheneb))
48
+
49
+ * html2haml now includes an `--html-attributes` option.
50
+ (thanks [Stefan Natchev](https://github.com/snatchev))
51
+
52
+ * Fix for inner whitespace removal in loops.
53
+ (thanks [Richard Michael](https://github.com/richardkmichael))
54
+
55
+ * Use numeric character references rather than HTML entities when escaping
56
+ double quotes and apostrophes in attributes. This works around some bugs in
57
+ Internet Explorer earlier than version 9.
58
+ (thanks [Doug Mayer](https://github.com/doxavore))
59
+
60
+ * Fix multiline silent comments: Haml previously did not allow free indentation
61
+ inside multline silent comments.
62
+
63
+ ## 3.1.6
64
+
65
+ * In indented mode, don't reindent buffers that contain preserved tags, and
66
+ provide a better workaround for Rails 3.2.3's textarea helpers.
67
+
68
+ ## 3.1.5
69
+
70
+ * Respect Rails' `html_safe` flag when escaping attribute values
71
+ (thanks to [Gerad Suyderhoud](https://github.com/gerad)).
72
+
73
+ * Fix for Rails 3.2.3 textarea helpers
74
+ (thanks to [James Coleman](https://github.com/jcoleman) and others).
75
+
76
+ ## 3.1.4
77
+
78
+ * Fix the use of `FormBuilder#block` with a label in Haml.
79
+ * Fix indentation after a self-closing tag with dynamic attributes.
80
+
81
+ ## 3.1.3
82
+
83
+ * Stop partial layouts from being displayed twice.
84
+
85
+ ## 3.1.2
86
+
87
+ * If the ActionView `#capture` helper is used in a Haml template but without any Haml being run in the block,
88
+ return the value of the block rather than the captured buffer.
89
+
90
+ * Don't throw errors when text is nested within comments.
91
+
92
+ * Fix html2haml.
93
+
94
+ * Fix an issue where destructive modification was sometimes performed on Rails SafeBuffers.
95
+
96
+ * Use character code entities for attribute value replacements instead of named/keyword entities.
97
+
98
+ ## 3.1.1
99
+
100
+ * Update the vendored Sass to version 3.1.0.
101
+
102
+ ## 3.1.0
103
+
104
+ * Don't add a `type` attribute to `<script>` and `<style>` tags generated by filters
105
+ when `:format` is set to `:html5`.
106
+
107
+ * Add an {file:HAML_REFERENCE.md#escape_attrs-option `:escape_attrs` option}
108
+ that allows attributes to either remain unescaped
109
+ (for things like embedding PHP directives in Haml)
110
+ or to be always escaped rather than `#escape_once`d.
111
+ This can also be used from the command line via `--no-escape-attrs`.
112
+
113
+ * Allow custom filters to be loaded from the command line.
114
+
115
+ ### Backwards Incompatibilities -- Must Read!
116
+
117
+ * Get rid of the `--rails` flag for the `haml` executable.
118
+ This flag hasn't been necessary since Rails 2.0.
119
+ Existing Rails 2.0 installations will continue to work.
120
+
121
+ * Drop support for Hpricot 0.7. 0.8 has been out for nearly two years.
122
+
123
+ ## 3.0.25
124
+
125
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.25).
126
+
127
+ * HTML-to-Haml conversion now works within Ruby even if Hpricot is loaded before `haml/html`.
128
+
129
+ ## 3.0.24
130
+
131
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.24).
132
+
133
+ * `html2haml` now properly generates Haml for silent script expressions
134
+ nested within blocks.
135
+
136
+ * IronRuby compatibility. This is sort of a hack: IronRuby reports its version as 1.9,
137
+ but it doesn't support the encoding APIs, so we treat it as 1.8 instead.
138
+
139
+ ## 3.0.23
140
+
141
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.23).
142
+
143
+ * Fix the error message for unloadable modules when running the executables under Ruby 1.9.2.
144
+
145
+ * Fix an error when combining old-style and new-style attributes.
146
+
147
+ ## 3.0.22
148
+
149
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.22).
150
+
151
+ * Allow an empty line after `case` but before `when`.
152
+
153
+ * Remove `vendor/sass`, which snuck into the gem by mistake
154
+ and was causing trouble for Heroku users (thanks to [Jacques Crocker](http://railsjedi.com/)).
155
+
156
+ * Support the Rails 3.1 template handler API.
157
+
158
+ ## 3.0.21
159
+
160
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.21).
161
+
162
+ * Fix the permissions errors for good.
163
+
164
+ ## 3.0.20
165
+
166
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.20).
167
+
168
+ * Fix some permissions errors.
169
+
170
+ ## 3.0.19
171
+
172
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.19).
173
+
174
+ * Fix the `:encoding` option under Ruby 1.9.2.
175
+
176
+ * Fix interpolated if statement when HTML escaping is enabled.
177
+
178
+ * Allow the `--unix-newlines` flag to work on Unix, where it's a no-op.
179
+
180
+ ## 3.0.18
181
+
182
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.18).
183
+
184
+ * Don't require `rake` in the gemspec, for bundler compatibility under
185
+ JRuby. Thanks to [Gordon McCreight](http://www.gmccreight.com/blog).
186
+
187
+ * Get rid of the annoying RDoc errors on install.
188
+
189
+ * Disambiguate references to the `Rails` module when `haml-rails` is installed.
190
+
191
+ * Fix a bug in `haml_tag` that would allow duplicate attributes to be added
192
+ and make `data-` attributes not work.
193
+
194
+ * Compatibility with Rails 3 final.
195
+
196
+ ## 3.0.17
197
+
198
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.17).
199
+
200
+ * Understand that mingw counts as Windows.
201
+
202
+ ## 3.0.16
203
+
204
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.16).
205
+
206
+ * Fix an html2haml ERB-parsing bug where ERB blocks were occasionally
207
+ left without indentation in Haml.
208
+
209
+ * Fix parsing of `if` and `case` statements whose values were assigned to variables.
210
+ This is still bad style, though.
211
+
212
+ * Fix `form_for` and `form_tag` when they're passed a block that
213
+ returns a string in a helper.
214
+
215
+ ## 3.0.15
216
+
217
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.15).
218
+
219
+ There were no changes made to Haml between versions 3.0.14 and 3.0.15.
220
+
221
+ ## 3.0.14
222
+
223
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.14).
224
+
225
+ * Allow CSS-style classes and ids to contain colons.
226
+
227
+ * Fix an obscure bug with if statements.
228
+
229
+ ### Rails 3 Support
230
+
231
+ * Don't use the `#returning` method, which Rails 3 no longer provides.
232
+
233
+ ## 3.0.13
234
+
235
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.13).
236
+
237
+ ## Rails 3 Support
238
+
239
+ Support for Rails 3 versions prior to beta 4 has been removed.
240
+ Upgrade to Rails 3.0.0.beta4 if you haven't already.
241
+
242
+ ### Minor Improvements
243
+
244
+ * Properly process frozen strings with encoding declarations.
245
+
246
+ ## 3.0.12
247
+
248
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.12).
249
+
250
+ ## Rails 3 Support
251
+
252
+ Apparently the last version broke in new and exciting ways under Rails 3,
253
+ due to the inconsistent load order caused by certain combinations of gems.
254
+ 3.0.12 hacks around that inconsistency, and *should* be fully Rails 3-compatible.
255
+
256
+ ### Deprecated: Rails 3 Beta 3
257
+
258
+ Haml's support for Rails 3.0.0.beta.3 has been deprecated.
259
+ Haml 3.0.13 will only support 3.0.0.beta.4.
260
+
261
+ ## 3.0.11
262
+
263
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.11).
264
+
265
+ ## 3.0.10
266
+
267
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.10).
268
+
269
+ ### Appengine-JRuby Support
270
+
271
+ The way we determine the location of the Haml installation
272
+ no longer breaks the version of JRuby
273
+ used by [`appengine-jruby`](http://code.google.com/p/appengine-jruby/).
274
+
275
+ ### Bug Fixes
276
+
277
+ * Single-line comments are now handled properly by `html2haml`.
278
+
279
+ ## 3.0.9
280
+
281
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.9).
282
+
283
+ There were no changes made to Haml between versions 3.0.8 and 3.0.9.
284
+ A bug in Gemcutter caused the gem to be uploaded improperly.
285
+
286
+ ## 3.0.8
287
+
288
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.8).
289
+
290
+ * Fix a bug with Rails versions prior to Rails 3.
291
+
292
+ ## 3.0.7
293
+
294
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.7).
295
+
296
+ ### Encoding Support
297
+
298
+ Haml 3.0.7 adds support for Ruby-style `-# coding:` comments
299
+ for declaring the encoding of a template.
300
+ For details see {file:HAML_REFERENCE.md#encodings the reference}.
301
+
302
+ This also slightly changes the behavior of Haml when the
303
+ {file:HAML_REFERENCE.md#encoding-option `:encoding` option} is not set.
304
+ Rather than defaulting to `"utf-8"`,
305
+ it defaults to the encoding of the source document,
306
+ and only falls back to `"utf-8"` if this encoding is `"us-ascii"`.
307
+
308
+ The `haml` executable also now takes an `-E` option for specifying encoding,
309
+ which works the same way as Ruby's `-E` option.
310
+
311
+ ### Other Changes
312
+
313
+ * Default to the {file:HAML_REFERENCE.md#format-option `:html5` format}
314
+ when running under Rails 3,
315
+ since it defaults to HTML5 as well.
316
+
317
+ ### Bug Fixes
318
+
319
+ * When generating Haml for something like `<span>foo</span>,`,
320
+ use `= succeed` rather than `- succeed` (which doesn't work).
321
+
322
+ ## 3.0.6
323
+
324
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.6).
325
+
326
+ ### Rails 2.3.7 Support
327
+
328
+ This release fully supports Rails 2.3.7.
329
+
330
+ ### Rails 2.3.6 Support Removed
331
+
332
+ Rails 2.3.6 was released with various bugs related to XSS-protection
333
+ and interfacing with Haml.
334
+ Rails 2.3.7 was released shortly after with fixes for these bugs.
335
+ Thus, Haml no longer supports Rails 2.3.6,
336
+ and anyone using it should upgrade to 2.3.7.
337
+
338
+ Attempting to use Haml with Rails 2.3.6 will cause an error.
339
+
340
+ ## 3.0.5
341
+
342
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.5).
343
+
344
+ ### Rails 2.3.6 Support
345
+
346
+ This release hacks around various bugs in Rails 2.3.6,
347
+ bringing Haml up to full compatibility.
348
+
349
+ ### Rails 3 Support
350
+
351
+ Make sure the `#capture` helper in Rails 3
352
+ doesn't print its value directly to the template.
353
+
354
+ ## 3.0.4
355
+
356
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.4).
357
+
358
+ There were no changes made to Haml between versions 3.0.3 and 3.0.4.
359
+
360
+ ## 3.0.3
361
+
362
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.3).
363
+
364
+ ### Rails 3 Support
365
+
366
+ In order to make some Rails loading errors easier to debug,
367
+ Sass will now raise an error if `Rails.root` is `nil` when Sass is loading.
368
+ Previously, this would just cause the paths to be mis-set.
369
+
370
+ ## 3.0.2
371
+
372
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.2).
373
+
374
+ There were no changes made to Haml between versions 3.0.1 and 3.0.2.
375
+
376
+ ## 3.0.1
377
+
378
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.1).
379
+
380
+ ### Installation in Rails
381
+
382
+ `haml --rails` is no longer necessary for installing Haml in Rails.
383
+ Now all you need to do is add `gem "haml"` to the Gemfile for Rails 3,
384
+ or add `config.gem "haml"` to `config/environment.rb` for previous versions.
385
+
386
+ `haml --rails` will still work,
387
+ but it has been deprecated and will print an error message.
388
+ It will not work in the next version of Haml.
389
+
390
+ ### Rails Test Speed
391
+
392
+ The {file:HAML_REFERENCE.md#ugly-option `:ugly` option} is now on by default
393
+ in the testing environment in Rails to help tests run faster.
394
+
395
+ ## 3.0.0
396
+ {#3-0-0}
397
+
398
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.0).
399
+
400
+ ### Backwards Incompatibilities: Must Read!
401
+
402
+ * The `puts` helper has been removed.
403
+ Use {Haml::Helpers#haml\_concat} instead.
404
+
405
+ ### More Useful Multiline
406
+
407
+ Ruby code can now be wrapped across multiple lines
408
+ as long as each line but the last ends in a comma.
409
+ For example:
410
+
411
+ = link_to_remote "Add to cart",
412
+ :url => { :action => "add", :id => product.id },
413
+ :update => { :success => "cart", :failure => "error" }
414
+
415
+ ### `haml_tag` and `haml_concat` Improvements
416
+
417
+ #### `haml_tag` with CSS Selectors
418
+
419
+ The {Haml::Helpers#haml_tag haml\_tag} helper can now take a string
420
+ using the same class/id shorthand as in standard Haml code.
421
+ Manually-specified class and id attributes are merged,
422
+ again as in standard Haml code.
423
+ For example:
424
+
425
+ haml_tag('#foo') #=> <div id='foo' />
426
+ haml_tag('.bar') #=> <div class='bar' />
427
+ haml_tag('span#foo.bar') #=> <span class='bar' id='foo' />
428
+ haml_tag('span#foo.bar', :class => 'abc') #=> <span class='abc bar' id='foo' />
429
+ haml_tag('span#foo.bar', :id => 'abc') #=> <span class='bar' id='abc_foo' />
430
+
431
+ Cheers, [S. Burkhard](http://github.com/hasclass/).
432
+
433
+ #### `haml_tag` with Multiple Lines of Content
434
+
435
+ The {Haml::Helpers#haml_tag haml\_tag} helper also does a better job
436
+ of formatting tags with multiple lines of content.
437
+ If a tag has multiple levels of content,
438
+ that content is indented beneath the tag.
439
+ For example:
440
+
441
+ haml_tag(:p, "foo\nbar") #=>
442
+ # <p>
443
+ # foo
444
+ # bar
445
+ # </p>
446
+
447
+ #### `haml_tag` with Multiple Lines of Content
448
+
449
+ Similarly, the {Haml::Helpers#haml_concat haml\_concat} helper
450
+ will properly indent multiple lines of content.
451
+ For example:
452
+
453
+ haml_tag(:p) {haml_concat "foo\nbar"} #=>
454
+ # <p>
455
+ # foo
456
+ # bar
457
+ # </p>
458
+
459
+ #### `haml_tag` and `haml_concat` with `:ugly`
460
+
461
+ When the {file:HAML_REFERENCE.md#ugly-option `:ugly` option} is enabled,
462
+ {Haml::Helpers#haml_tag haml\_tag} and {Haml::Helpers#haml_concat haml\_concat}
463
+ won't do any indentation of their arguments.
464
+
465
+ ### Basic Tag Improvements
466
+
467
+ * It's now possible to customize the name used for {file:HAML_REFERENCE.md#object_reference_ object reference}
468
+ for a given object by implementing the `haml_object_ref` method on that object.
469
+ This method should return a string that will be used in place of the class name of the object
470
+ in the generated class and id.
471
+ Thanks to [Tim Carey-Smith](http://twitter.com/halorgium).
472
+
473
+ * All attribute values may be non-String types.
474
+ Their `#to_s` method will be called to convert them to strings.
475
+ Previously, this only worked for attributes other than `class`.
476
+
477
+ ### `:class` and `:id` Attributes Accept Ruby Arrays
478
+
479
+ In an attribute hash, the `:class` attribute now accepts an Array
480
+ whose elements will be converted to strings and joined with <nobr>`" "`</nobr>.
481
+ Likewise, the `:id` attribute now accepts an Array
482
+ whose elements will be converted to strings and joined with `"_"`.
483
+ The array will first be flattened and any elements that do not test as true
484
+ will be stripped out. For example:
485
+
486
+ .column{:class => [@item.type, @item == @sortcol && [:sort, @sortdir]] }
487
+
488
+ could render as any of:
489
+
490
+ class="column numeric sort ascending"
491
+ class="column numeric"
492
+ class="column sort descending"
493
+ class="column"
494
+
495
+ depending on whether `@item.type` is `"numeric"` or `nil`,
496
+ whether `@item == @sortcol`,
497
+ and whether `@sortdir` is `"ascending"` or `"descending"`.
498
+
499
+ A single value can still be specified.
500
+ If that value evaluates to false it is ignored;
501
+ otherwise it gets converted to a string.
502
+ For example:
503
+
504
+ .item{:class => @item.is_empty? && "empty"}
505
+
506
+ could render as either of:
507
+
508
+ class="item"
509
+ class="item empty"
510
+
511
+ Thanks to [Ronen Barzel](http://www.ronenbarzel.org/).
512
+
513
+ ### HTML5 Custom Data Attributes
514
+
515
+ Creating an attribute named `:data` with a Hash value
516
+ will generate [HTML5 custom data attributes](http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#embedding-custom-non-visible-data).
517
+ For example:
518
+
519
+ %div{:data => {:author_id => 123, :post_id => 234}}
520
+
521
+ Will compile to:
522
+
523
+ <div data-author_id='123' data-post_id='234'></div>
524
+
525
+ Thanks to [John Reilly](http://twitter.com/johnreilly).
526
+
527
+ ### More Powerful `:autoclose` Option
528
+
529
+ The {file:HAML_REFERENCE.md#attributes_option `:attributes`} option
530
+ can now take regular expressions that specify which tags to make self-closing.
531
+
532
+ ### `--double-quote-attributes` Option
533
+
534
+ The Haml executable now has a `--double-quote-attributes` option (short form: `-q`)
535
+ that causes attributes to use a double-quote mark rather than single-quote.
536
+ Thanks to [Charles Roper](http://charlesroper.com/).
537
+
538
+ ### `:css` Filter
539
+
540
+ Haml now supports a {file:HAML_REFERENCE.md#css-filter `:css` filter}
541
+ that surrounds the filtered text with `<style>` and CDATA tags.
542
+
543
+ ### `haml-spec` Integration
544
+
545
+ We've added the cross-implementation tests from the [haml-spec](http://github.com/norman/haml-spec) project
546
+ to the standard Haml test suite, to be sure we remain compatible with the base functionality
547
+ of the many and varied [Haml implementations](http://en.wikipedia.org/wiki/Haml#Implementations).
548
+
549
+ ### Ruby 1.9 Support
550
+
551
+ * Haml and `html2haml` now produce more descriptive errors
552
+ when given a template with invalid byte sequences for that template's encoding,
553
+ including the line number and the offending character.
554
+
555
+ * Haml and `html2haml` now accept Unicode documents with a
556
+ [byte-order-mark](http://en.wikipedia.org/wiki/Byte_order_mark).
557
+
558
+ ### Rails Support
559
+
560
+ * When `form_for` is used with `=`, or `form_tag` is used with `=` and a block,
561
+ they will now raise errors explaining that they should be used with `-`.
562
+ This is similar to how {Haml::Helpers#haml\_concat} behaves,
563
+ and will hopefully clear up some difficult bugs for some users.
564
+
565
+ ### Rip Support
566
+
567
+ Haml is now compatible with the [Rip](http://hellorip.com/) package management system.
568
+ Thanks to [Josh Peek](http://joshpeek.com/).
569
+
570
+ ### `html2haml` Improvements
571
+
572
+ * Ruby blocks within ERB are now supported.
573
+ The Haml code is properly indented and the `end`s are removed.
574
+ This includes methods with blocks and all language constructs
575
+ such as `if`, `begin`, and `case`.
576
+ For example:
577
+
578
+ <% content_for :footer do %>
579
+ <p>Hi there!</p>
580
+ <% end %>
581
+
582
+ is now transformed into:
583
+
584
+ - content_for :footer do
585
+ %p Hi there!
586
+
587
+ Thanks to [Jack Chen](http://chendo.net) and [Dr. Nic Williams](http://drnicwilliams)
588
+ for inspiring this and creating the first draft of the code.
589
+
590
+ * Inline HTML text nodes are now transformed into inline Haml text.
591
+ For example, `<p>foo</p>` now becomes `%p foo`, whereas before it became:
592
+
593
+ %p
594
+ foo
595
+
596
+ The same is true for inline comments,
597
+ and inline ERB when running in ERB mode:
598
+ `<p><%= foo %></p>` will now become `%p= foo`.
599
+
600
+ * ERB included within text is now transformed into Ruby interpolation.
601
+ For example:
602
+
603
+ <p>
604
+ Foo <%= bar %> baz!
605
+ Flip <%= bang %>.
606
+ </p>
607
+
608
+ is now transformed into:
609
+
610
+ %p
611
+ Foo #{bar} baz!
612
+ Flip #{bang}.
613
+
614
+ * `<script>` tags are now transformed into `:javascript` filters,
615
+ and `<style>` tags into `:css` filters.
616
+ and indentation is preserved.
617
+ For example:
618
+
619
+ <script type="text/javascript">
620
+ function foo() {
621
+ return 12;
622
+ }
623
+ </script>
624
+
625
+ is now transformed into:
626
+
627
+ :javascript
628
+ function foo() {
629
+ return 12;
630
+ }
631
+
632
+ * `<pre>` and `<textarea>` tags are now transformed into the `:preserve` filter.
633
+ For example:
634
+
635
+ <pre>Foo
636
+ bar
637
+ baz</pre>
638
+
639
+ is now transformed into:
640
+
641
+ %pre
642
+ :preserve
643
+ Foo
644
+ bar
645
+ baz
646
+
647
+ * Self-closing tags (such as `<br />`) are now transformed into
648
+ self-closing Haml tags (like `%br/`).
649
+
650
+ * IE conditional comments are now properly parsed.
651
+
652
+ * Attributes are now output in a more-standard format,
653
+ without spaces within the curly braces
654
+ (e.g. `%p{:foo => "bar"}` as opposed to `%p{ :foo => "bar" }`).
655
+
656
+ * IDs and classes containing `#` and `.` are now output as string attributes
657
+ (e.g. `%p{:class => "foo.bar"}`).
658
+
659
+ * Attributes are now sorted, to maintain a deterministic order.
660
+
661
+ * `>` or {Haml::Helpers#succeed #succeed} are inserted where necessary
662
+ when inline formatting is used.
663
+
664
+ * Multi-line ERB statements are now properly indented,
665
+ and those without any content are removed.
666
+
667
+ ### Minor Improvements
668
+
669
+ * {Haml::Helpers#capture_haml capture\_haml} is now faster when using `:ugly`.
670
+ Thanks to [Alf Mikula](http://alfmikula.blogspot.com/).
671
+
672
+ * Add an `RDFa` doctype shortcut.
673
+
674
+ ## 2.2.24
675
+
676
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.24).
677
+
678
+ * Don't prevent ActiveModel form elements from having error formatting applied.
679
+
680
+ * Make sure `form_for` blocks are properly indented under Rails 3.0.0.beta.3.
681
+
682
+ * Don't activate a bug in the `dynamic_form` plugin under Rails 3.0.0.beta.3
683
+ that would cause its methods not to be loaded.
684
+
685
+ ## 2.2.23
686
+
687
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.23).
688
+
689
+ * Don't crash when `rake gems` is run in Rails with Haml installed.
690
+ Thanks to [Florian Frank](http://github.com/flori).
691
+
692
+ * Don't remove `\n` in filters with interpolation.
693
+
694
+ * Silence those annoying `"regexp match /.../n against to UTF-8 string"` warnings.
695
+
696
+ ## 2.2.22
697
+
698
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.22).
699
+
700
+ * Add a railtie so Haml and Sass will be automatically loaded in Rails 3.
701
+ Thanks to [Daniel Neighman](http://pancakestacks.wordpress.com/).
702
+
703
+ * Add a deprecation message for using `-` with methods like `form_for`
704
+ that return strings in Rails 3.
705
+ This is [the same deprecation that exists in Rails 3](http://github.com/rails/rails/commit/9de83050d3a4b260d4aeb5d09ec4eb64f913ba64).
706
+
707
+ * Make sure line numbers are reported correctly when filters are being used.
708
+
709
+ * Make loading the gemspec not crash on read-only filesystems like Heroku's.
710
+
711
+ * Don't crash when methods like `form_for` return `nil` in, for example, Rails 3 beta.
712
+
713
+ * Compatibility with Rails 3 beta's RJS facilities.
714
+
715
+ ## 2.2.21
716
+
717
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.21).
718
+
719
+ * Fix a few bugs in the git-revision-reporting in {Haml::Version#version}.
720
+ In particular, it will still work if `git gc` has been called recently,
721
+ or if various files are missing.
722
+
723
+ * Always use `__FILE__` when reading files within the Haml repo in the `Rakefile`.
724
+ According to [this bug report](http://github.com/carlhuda/bundler/issues/issue/44),
725
+ this should make Haml work better with Bundler.
726
+
727
+ * Make the error message for `- end` a little more intuitive based on user feedback.
728
+
729
+ * Compatibility with methods like `form_for`
730
+ that return strings rather than concatenate to the template in Rails 3.
731
+
732
+ * Add a {Haml::Helpers#with_tabs with_tabs} helper,
733
+ which sets the indentation level for the duration of a block.
734
+
735
+ ## 2.2.20
736
+
737
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.20).
738
+
739
+ * The `form_tag` Rails helper is now properly marked as HTML-safe
740
+ when using Rails' XSS protection with Rails 2.3.5.
741
+
742
+ * Calls to `defined?` shouldn't interfere with Rails' autoloading
743
+ in very old versions (1.2.x).
744
+
745
+ * Fix a bug where calls to ActionView's `render` method
746
+ with blocks and layouts wouldn't work under the Rails 3.0 beta.
747
+
748
+ * Fix a bug where the closing tags of nested calls to \{Haml::Helpers#haml\_concat}
749
+ were improperly escaped under the Rails 3.0 beta.
750
+
751
+ ## 2.2.19
752
+
753
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.19).
754
+
755
+ * Fix a bug with the integration with Rails' XSS support.
756
+ In particular, correctly override `safe_concat`.
757
+
758
+ ## 2.2.18
759
+
760
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.18).
761
+
762
+ * Support [the new XSS-protection API](http://yehudakatz.com/2010/02/01/safebuffers-and-rails-3-0/)
763
+ used in Rails 3.
764
+
765
+ * Use `Rails.env` rather than `RAILS_ENV` when running under Rails 3.0.
766
+ Thanks to [Duncan Grazier](http://duncangrazier.com/).
767
+
768
+ * Add a `--unix-newlines` flag to all executables
769
+ for outputting Unix-style newlines on Windows.
770
+
771
+ * Fix a couple bugs with the `:erb` filter:
772
+ make sure error reporting uses the correct line numbers,
773
+ and allow multi-line expressions.
774
+
775
+ * Fix a parsing bug for HTML-style attributes including `#`.
776
+
777
+ ## 2.2.17
778
+
779
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.17).
780
+
781
+ * Fix compilation of HTML5 doctypes when using `html2haml`.
782
+
783
+ * `nil` values for Sass options are now ignored,
784
+ rather than raising errors.
785
+
786
+ ## 2.2.16
787
+
788
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.16).
789
+
790
+ * Abstract out references to `ActionView::TemplateError`,
791
+ `ActionView::TemplateHandler`, etc.
792
+ These have all been renamed to `ActionView::Template::*`
793
+ in Rails 3.0.
794
+
795
+ ## 2.2.15
796
+
797
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.15).
798
+
799
+ * Allow `if` statements with no content followed by `else` clauses.
800
+ For example:
801
+
802
+ - if foo
803
+ - else
804
+ bar
805
+
806
+ ## 2.2.14
807
+
808
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.14).
809
+
810
+ * Don't print warnings when escaping attributes containing non-ASCII characters
811
+ in Ruby 1.9.
812
+
813
+ * Don't crash when parsing an XHTML Strict doctype in `html2haml`.
814
+
815
+ * Support the HTML5 doctype in an XHTML document
816
+ by using `!!! 5` as the doctype declaration.
817
+
818
+ ## 2.2.13
819
+
820
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.13).
821
+
822
+ * Allow users to specify {file:HAML_REFERENCE.md#encoding_option `:encoding => "ascii-8bit"`}
823
+ even for templates that include non-ASCII byte sequences.
824
+ This makes Haml templates not crash when given non-ASCII input
825
+ that's marked as having an ASCII encoding.
826
+
827
+ * Fixed an incompatibility with Hpricot 0.8.2, which is used for `html2haml`.
828
+
829
+ ## 2.2.12
830
+
831
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.12).
832
+
833
+ There were no changes made to Haml between versions 2.2.11 and 2.2.12.
834
+
835
+ ## 2.2.11
836
+
837
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.11).
838
+
839
+ * Fixed a bug with XSS protection where HTML escaping would raise an error
840
+ if passed a non-string value.
841
+ Note that this doesn't affect any HTML escaping when XSS protection is disabled.
842
+
843
+ * Fixed a bug in outer-whitespace nuking where whitespace-only Ruby strings
844
+ blocked whitespace nuking beyond them.
845
+
846
+ * Use `ensure` to protect the resetting of the Haml output buffer
847
+ against exceptions that are raised within the compiled Haml code.
848
+
849
+ * Fix an error line-numbering bug that appeared if an error was thrown
850
+ within loud script (`=`).
851
+ This is not the best solution, as it disables a few optimizations,
852
+ but it shouldn't have too much effect and the optimizations
853
+ will hopefully be re-enabled in version 2.4.
854
+
855
+ * Don't crash if the plugin skeleton is installed and `rake gems:install` is run.
856
+
857
+ * Don't use `RAILS_ROOT` directly.
858
+ This no longer exists in Rails 3.0.
859
+ Instead abstract this out as `Haml::Util.rails_root`.
860
+ This changes makes Haml fully compatible with edge Rails as of this writing.
861
+
862
+ ## 2.2.10
863
+
864
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.10).
865
+
866
+ * Fixed a bug where elements with dynamic attributes and no content
867
+ would have too much whitespace between the opening and closing tag.
868
+
869
+ * Changed `rails/init.rb` away from loading `init.rb` and instead
870
+ have it basically copy the content.
871
+ This allows us to transfer the proper binding to `Haml.init_rails`.
872
+
873
+ * Make sure Haml only tries to enable XSS protection integration
874
+ once all other plugins are loaded.
875
+ This allows it to work properly when Haml is a gem
876
+ and the `rails_xss` plugin is being used.
877
+
878
+ * Mark the return value of Haml templates as HTML safe.
879
+ This makes Haml partials work with Rails' XSS protection.
880
+
881
+ ## 2.2.9
882
+
883
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.9).
884
+
885
+ * Fixed a bug where Haml's text was concatenated to the wrong buffer
886
+ under certain circumstances.
887
+ This was mostly an issue under Rails when using methods like `capture`.
888
+
889
+ * Fixed a bug where template text was escaped when there was interpolation in a line
890
+ and the `:escape_html` option was enabled. For example:
891
+
892
+ Foo &lt; Bar #{"<"} Baz
893
+
894
+ with `:escape_html` used to render as
895
+
896
+ Foo &amp;lt; Bar &lt; Baz
897
+
898
+ but now renders as
899
+
900
+ Foo &lt; Bar &lt; Baz
901
+
902
+ ### Rails XSS Protection
903
+
904
+ Haml 2.2.9 supports the XSS protection in Rails versions 2.3.5+.
905
+ There are several components to this:
906
+
907
+ * If XSS protection is enabled, Haml's {file:HAML_REFERENCE.md#escape_html-option `:escape_html`}
908
+ option is set to `true` by default.
909
+
910
+ * Strings declared as HTML safe won't be escaped by Haml,
911
+ including the {file:Haml/Helpers.html#html_escape-instance_method `#html_escape`} helper
912
+ and `&=` if `:escape_html` has been disabled.
913
+
914
+ * Haml helpers that generate HTML are marked as HTML safe,
915
+ and will escape their input if it's not HTML safe.
916
+
917
+ ## 2.2.8
918
+
919
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.8).
920
+
921
+ * Fixed a potential XSS issue with HTML escaping and wacky Unicode nonsense.
922
+ This is the same as [the issue fixed in Rails](http://groups.google.com/group/rubyonrails-security/browse_thread/thread/48ab3f4a2c16190f) a bit ago.
923
+
924
+ ## 2.2.7
925
+
926
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.7).
927
+
928
+ * Fixed an `html2haml` issue where ERB attribute values
929
+ weren't HTML-unescaped before being transformed into Haml.
930
+
931
+ * Fixed an `html2haml` issue where `#{}` wasn't escaped
932
+ before being transformed into Haml.
933
+
934
+ * Add `<code>` to the list of tags that's
935
+ {file:HAML_REFERENCE.md#preserve-option automatically whitespace-preserved}.
936
+
937
+ * Fixed a bug with `end` being followed by code in silent scripts -
938
+ it no longer throws an error when it's nested beneath tags.
939
+
940
+ * Fixed a bug with inner whitespace-nuking and conditionals.
941
+ The `else` et al. clauses of conditionals are now properly
942
+ whitespace-nuked.
943
+
944
+ ## 2.2.6
945
+
946
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.6).
947
+
948
+ * Made the error message when unable to load a dependency for html2haml
949
+ respect the `--trace` option.
950
+
951
+ * Don't crash when the `__FILE__` constant of a Ruby file is a relative path,
952
+ as apparently happens sometimes in TextMate
953
+ (thanks to [Karl Varga](http://github.com/kjvarga)).
954
+
955
+ * Add "Sass" to the `--version` string for the executables.
956
+
957
+ * Raise an exception when commas are omitted in static attributes
958
+ (e.g. `%p{:foo => "bar" :baz => "bang"}`).
959
+
960
+ ## 2.2.5
961
+
962
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.5).
963
+
964
+ * Got rid of trailing whitespace produced when opening a conditional comment
965
+ (thanks to [Norman Clarke](http://blog.njclarke.com/)).
966
+
967
+ * Fixed CSS id concatenation when a numeric id is given as an attribute.
968
+ (thanks to [Norman Clarke](http://blog.njclarke.com/)).
969
+
970
+ * Fixed a couple bugs with using "-end" in strings.
971
+
972
+ ## 2.2.4
973
+
974
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.4).
975
+
976
+ * Allow `end` to be used for silent script when it's followed by code.
977
+ For example:
978
+
979
+ - form_for do
980
+ ...
981
+ - end if @show_form
982
+
983
+ This isn't very good style, but we're supporting it for consistency's sake.
984
+
985
+ * Don't add `require 'rubygems'` to the top of init.rb when installed
986
+ via `haml --rails`. This isn't necessary, and actually gets
987
+ clobbered as soon as haml/template is loaded.
988
+
989
+ ## 2.2.3
990
+
991
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.3).
992
+
993
+ Haml 2.2.3 adds support for the JRuby bundling tools
994
+ for Google AppEngine, thanks to [Jan Ulbrich](http://github.com/ulbrich).
995
+
996
+ ## 2.2.2
997
+
998
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.2).
999
+
1000
+ Haml 2.2.2 is a minor bugfix release, with several notable changes.
1001
+ First, {file:Haml/Helpers.html#haml_concat-instance_method `haml_concat`}
1002
+ will now raise an error when used with `=`.
1003
+ This has always been incorrect behavior,
1004
+ and in fact has never actually worked.
1005
+ The only difference is that now it will fail loudly.
1006
+ Second, Ruby 1.9 is now more fully supported,
1007
+ especially with the {file:HAML_REFERENCE.md#htmlstyle_attributes_ new attribute syntax}.
1008
+ Third, filters are no longer escaped when the {file:HAML_REFERENCE.md#escape_html-option `:escape_html` option}
1009
+ is enabled and `#{}` interpolation is used.
1010
+
1011
+ ## 2.2.1
1012
+
1013
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.1).
1014
+
1015
+ Haml 2.2.1 is a minor bug-fix release.
1016
+
1017
+ ## 2.2.0
1018
+
1019
+ [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.0).
1020
+
1021
+ Haml 2.2 adds several new features to the language,
1022
+ fixes several bugs, and dramatically improves performance
1023
+ (particularly when running with {file:HAML_REFERENCE.md#ugly-option `:ugly`} enabled).
1024
+
1025
+ ### Syntax Changes
1026
+
1027
+ #### HTML-Style Attribute Syntax
1028
+
1029
+ Haml 2.2 introduces a new syntax for attributes
1030
+ based on the HTML syntax.
1031
+ For example:
1032
+
1033
+ %a(href="http://haml.info" title="Haml's so cool!")
1034
+ %img(src="/images/haml.png" alt="Haml")
1035
+
1036
+ There are two main reasons for this.
1037
+ First, the hash-style syntax is very Ruby-specific.
1038
+ There are now [Haml implementations](http://en.wikipedia.org/wiki/Haml#Implementations)
1039
+ in many languages, each of which has its own syntax for hashes
1040
+ (or dicts or associative arrays or whatever they're called).
1041
+ The HTML syntax will be adopted by all of them,
1042
+ so you can feel comfortable using Haml in whichever language you need.
1043
+
1044
+ Second, the hash-style syntax is quite verbose.
1045
+ `%img{:src => "/images/haml.png", :alt => "Haml"}`
1046
+ is eight characters longer than `%img(src="/images/haml.png" alt="Haml")`.
1047
+ Haml's supposed to be about writing templates quickly and easily;
1048
+ HTML-style attributes should help out a lot with that.
1049
+
1050
+ Ruby variables can be used as attribute values by omitting quotes.
1051
+ Local variables or instance variables can be used.
1052
+ For example:
1053
+
1054
+ %a(title=@title href=href) Stuff
1055
+
1056
+ This is the same as:
1057
+
1058
+ %a{:title => @title, :href => href} Stuff
1059
+
1060
+ Because there are no commas separating attributes,
1061
+ more complicated expressions aren't allowed.
1062
+ You can use `#{}` interpolation to insert complicated expressions
1063
+ in a HTML-style attribute, though:
1064
+
1065
+ %span(class="widget_#{@widget.number}")
1066
+
1067
+ #### Multiline Attributes
1068
+
1069
+ In general, Haml tries to keep individual elements on a single line.
1070
+ There is a [multiline syntax](#multiline) for overflowing onto further lines,
1071
+ but it's intentionally awkward to use to encourage shorter lines.
1072
+
1073
+ However, there is one case where overflow is reasonable: attributes.
1074
+ Often a tag will simply have a lot of attributes, and in this case
1075
+ it makes sense to allow overflow.
1076
+ You can now stretch an attribute hash across multiple lines:
1077
+
1078
+ %script{:type => "text/javascript",
1079
+ :src => "javascripts/script_#{2 + 7}"}
1080
+
1081
+ This also works for HTML-style attributes:
1082
+
1083
+ %script(type="text/javascript"
1084
+ src="javascripts/script_#{2 + 7}")
1085
+
1086
+ Note that for hash-style attributes, the newlines must come after commas.
1087
+
1088
+ #### Universal interpolation
1089
+
1090
+ In Haml 2.0, you could use `==` to interpolate Ruby code
1091
+ within a line of text using `#{}`.
1092
+ In Haml 2.2, the `==` is unnecessary;
1093
+ `#{}` can be used in any text.
1094
+ For example:
1095
+
1096
+ %p This is a really cool #{h what_is_this}!
1097
+ But is it a #{h what_isnt_this}?
1098
+
1099
+ In addition, to {file:HAML_REFERENCE.md#escaping_html escape} or {file:HAML_REFERENCE.md#unescaping_html unescape}
1100
+ the interpolated code, you can just add `&` or `!`, respectively,
1101
+ to the beginning of the line:
1102
+
1103
+ %p& This is a really cool #{what_is_this}!
1104
+ & But is it a #{what_isnt_this}?
1105
+
1106
+ #### Flexible indentation
1107
+
1108
+ Haml has traditionally required its users to use two spaces of indentation.
1109
+ This is the universal Ruby style, and still highly recommended.
1110
+ However, Haml now allows any number of spaces or even tabs for indentation,
1111
+ provided:
1112
+
1113
+ * Tabs and spaces are not mixed
1114
+ * The indentation is consistent within a given document
1115
+
1116
+ ### New Options
1117
+
1118
+ #### `:ugly`
1119
+
1120
+ The `:ugly` option is not technically new;
1121
+ it was introduced in Haml 2.0 to make rendering deeply nested templates less painful.
1122
+ However, it's been greatly empowered in Haml 2.2.
1123
+ It now does all sorts of performance optimizations
1124
+ that couldn't be done before,
1125
+ and its use increases Haml's performance dramatically.
1126
+ It's enabled by default in production in Rails,
1127
+ and it's highly recommended for production environments
1128
+ in other frameworks.
1129
+
1130
+ #### `:encoding` {#encoding-option}
1131
+
1132
+ This option specifies the encoding of the Haml template
1133
+ when running under Ruby 1.9. It defaults to `Encoding.default_internal` or `"utf-8"`.
1134
+ This is useful for making sure that you don't get weird
1135
+ encoding errors when dealing with non-ASCII input data.
1136
+
1137
+ ### Deprecations
1138
+
1139
+ #### `Haml::Helpers#puts`
1140
+
1141
+ This helper is being deprecated for the obvious reason
1142
+ that it conflicts with the `Kernel#puts` method.
1143
+ I'm ashamed I ever chose this name.
1144
+ Use `haml_concat` instead and spare me the embarrassment.
1145
+
1146
+ #### `= haml_tag`
1147
+
1148
+ A lot of people accidentally use "`= haml_tag`".
1149
+ This has always been wrong; `haml_tag` outputs directly to the template,
1150
+ and so should be used as "`- haml_tag`".
1151
+ Now it raises an error when you use `=`.
1152
+
1153
+ ### Compatibility
1154
+
1155
+ #### Rails
1156
+
1157
+ Haml 2.2 is fully compatible with Rails,
1158
+ from 2.0.6 to the latest revision of edge, 783db25.
1159
+
1160
+ #### Ruby 1.9
1161
+
1162
+ Haml 2.2 is also fully compatible with Ruby 1.9.
1163
+ It supports Ruby 1.9-style attribute hashes,
1164
+ and handles encoding-related issues
1165
+ (see [the `:encoding` option](#encoding-option)).
1166
+
1167
+ ### Filters
1168
+
1169
+ #### `:markdown`
1170
+
1171
+ There are numerous improvements to the Markdown filter.
1172
+ No longer will Haml attempt to use RedCloth's inferior Markdown implementation.
1173
+ Instead, it will look for all major Markdown implementations:
1174
+ [RDiscount](https://github.com/rtomayko/rdiscount),
1175
+ [RPeg-Markdown](https://github.com/rtomayko/rpeg-markdown),
1176
+ [Maruku](http://maruku.rubyforge.org),
1177
+ and [BlueCloth](http://www.deveiate.org/projects/BlueCloth).
1178
+
1179
+ #### `:cdata`
1180
+
1181
+ There is now a `:cdata` filter for wrapping text in CDATA tags.
1182
+
1183
+ #### `:sass`
1184
+
1185
+ The `:sass` filter now uses options set in `Sass::Plugin`,
1186
+ if they're available.
1187
+
1188
+ ### Executables
1189
+
1190
+ #### `haml`
1191
+
1192
+ The `haml` executable now takes `-r` and `-I` flags
1193
+ that act just like the same flags for the `ruby` executable.
1194
+ This allows users to load helper files when using Haml
1195
+ from the command line.
1196
+
1197
+ It also takes a `--debug` flag that causes it to spit out
1198
+ the Ruby code that Haml generates from the template.
1199
+ This is more for my benefit than anything,
1200
+ but you may find it interesting.
1201
+
1202
+ #### `html2haml`
1203
+
1204
+ The `html2haml` executable has undergone significant improvements.
1205
+ Many of these are bugfixes, but there are also a few features.
1206
+ For one, it now understands CDATA tags and autodetects ERB files.
1207
+ In addition, a line containing just "`- end`" is now a Haml error;
1208
+ since it's not possible for `html2haml` to properly parse all Ruby blocks,
1209
+ this acts as a signal for the author that there are blocks
1210
+ to be dealt with.
1211
+
1212
+ ### Miscellaneous
1213
+
1214
+ #### XHTML Mobile DTD
1215
+
1216
+ Haml 2.2 supports a DTD for XHTML Mobile: `!!! Mobile`.
1217
+
1218
+ #### YARD
1219
+
1220
+ All the documentation for Haml 2.2, including this changelog,
1221
+ has been moved to [YARD](http://yard.soen.ca).
1222
+ YARD is an excellent documentation system,
1223
+ and allows us to write our documentation in [Maruku](http://maruku.rubyforge.org),
1224
+ which is also excellent.