Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 18332 Bytes
1 | # Haml Changelog |
2 | |
3 | * Table of contents |
4 | {:toc} |
5 | |
6 | ## 2.2.24 |
7 | |
8 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.24). |
9 | |
10 | * Don't prevent ActiveModel form elements from having error formatting applied. |
11 | |
12 | * Make sure `form_for` blocks are properly indented under Rails 3.0.0.beta.3. |
13 | |
14 | * Don't activate a bug in the `dynamic_form` plugin under Rails 3.0.0.beta.3 |
15 | that would cause its methods not to be loaded. |
16 | |
17 | ## 2.2.23 |
18 | |
19 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.23). |
20 | |
21 | * Don't crash when `rake gems` is run in Rails with Haml installed. |
22 | Thanks to [Florian Frank](http://github.com/flori). |
23 | |
24 | * Don't remove `\n` in filters with interpolation. |
25 | |
26 | * Silence those annoying `"regexp match /.../n against to UTF-8 string"` warnings. |
27 | |
28 | ## 2.2.22 |
29 | |
30 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.22). |
31 | |
32 | * Add a railtie so Haml and Sass will be automatically loaded in Rails 3. |
33 | Thanks to [Daniel Neighman](http://pancakestacks.wordpress.com/). |
34 | |
35 | * Add a deprecation message for using `-` with methods like `form_for` |
36 | that return strings in Rails 3. |
37 | This is [the same deprecation that exists in Rails 3](http://github.com/rails/rails/commit/9de83050d3a4b260d4aeb5d09ec4eb64f913ba64). |
38 | |
39 | * Make sure line numbers are reported correctly when filters are being used. |
40 | |
41 | * Make loading the gemspec not crash on read-only filesystems like Heroku's. |
42 | |
43 | * Don't crash when methods like `form_for` return `nil` in, for example, Rails 3 beta. |
44 | |
45 | * Compatibility with Rails 3 beta's RJS facilities. |
46 | |
47 | ## 2.2.21 |
48 | |
49 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.21). |
50 | |
51 | * Fix a few bugs in the git-revision-reporting in {Haml::Version#version}. |
52 | In particular, it will still work if `git gc` has been called recently, |
53 | or if various files are missing. |
54 | |
55 | * Always use `__FILE__` when reading files within the Haml repo in the `Rakefile`. |
56 | According to [this bug report](http://github.com/carlhuda/bundler/issues/issue/44), |
57 | this should make Haml work better with Bundler. |
58 | |
59 | * Make the error message for `- end` a little more intuitive based on user feedback. |
60 | |
61 | * Compatibility with methods like `form_for` |
62 | that return strings rather than concatenate to the template in Rails 3. |
63 | |
64 | * Add a {Haml::Helpers#with_tabs with_tabs} helper, |
65 | which sets the indentation level for the duration of a block. |
66 | |
67 | ## 2.2.20 |
68 | |
69 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.20). |
70 | |
71 | * The `form_tag` Rails helper is now properly marked as HTML-safe |
72 | when using Rails' XSS protection with Rails 2.3.5. |
73 | |
74 | * Calls to `defined?` shouldn't interfere with Rails' autoloading |
75 | in very old versions (1.2.x). |
76 | |
77 | * Fix a bug where calls to ActionView's `render` method |
78 | with blocks and layouts wouldn't work under the Rails 3.0 beta. |
79 | |
80 | * Fix a bug where the closing tags of nested calls to \{Haml::Helpers#haml\_concat} |
81 | were improperly escaped under the Rails 3.0 beta. |
82 | |
83 | ## 2.2.19 |
84 | |
85 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.19). |
86 | |
87 | * Fix a bug with the integration with Rails' XSS support. |
88 | In particular, correctly override `safe_concat`. |
89 | |
90 | ## 2.2.18 |
91 | |
92 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.18). |
93 | |
94 | * Support [the new XSS-protection API](http://yehudakatz.com/2010/02/01/safebuffers-and-rails-3-0/) |
95 | used in Rails 3. |
96 | |
97 | * Use `Rails.env` rather than `RAILS_ENV` when running under Rails 3.0. |
98 | Thanks to [Duncan Grazier](http://duncangrazier.com/). |
99 | |
100 | * Add a `--unix-newlines` flag to all executables |
101 | for outputting Unix-style newlines on Windows. |
102 | |
103 | * Fix a couple bugs with the `:erb` filter: |
104 | make sure error reporting uses the correct line numbers, |
105 | and allow multi-line expressions. |
106 | |
107 | * Fix a parsing bug for HTML-style attributes including `#`. |
108 | |
109 | ## 2.2.17 |
110 | |
111 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.17). |
112 | |
113 | * Fix compilation of HTML5 doctypes when using `html2haml`. |
114 | |
115 | * `nil` values for Sass options are now ignored, |
116 | rather than raising errors. |
117 | |
118 | ## 2.2.16 |
119 | |
120 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.16). |
121 | |
122 | * Abstract out references to `ActionView::TemplateError`, |
123 | `ActionView::TemplateHandler`, etc. |
124 | These have all been renamed to `ActionView::Template::*` |
125 | in Rails 3.0. |
126 | |
127 | ## 2.2.15 |
128 | |
129 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.15). |
130 | |
131 | * Allow `if` statements with no content followed by `else` clauses. |
132 | For example: |
133 | |
134 | - if foo |
135 | - else |
136 | bar |
137 | |
138 | ## 2.2.14 |
139 | |
140 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.14). |
141 | |
142 | * Don't print warnings when escaping attributes containing non-ASCII characters |
143 | in Ruby 1.9. |
144 | |
145 | * Don't crash when parsing an XHTML Strict doctype in `html2haml`. |
146 | |
147 | * Support the HTML5 doctype in an XHTML document |
148 | by using `!!! 5` as the doctype declaration. |
149 | |
150 | ## 2.2.13 |
151 | |
152 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.13). |
153 | |
154 | * Allow users to specify {file:HAML_REFERENCE.md#encoding_option `:encoding => "ascii-8bit"`} |
155 | even for templates that include non-ASCII byte sequences. |
156 | This makes Haml templates not crash when given non-ASCII input |
157 | that's marked as having an ASCII encoding. |
158 | |
159 | * Fixed an incompatibility with Hpricot 0.8.2, which is used for `html2haml`. |
160 | |
161 | ## 2.2.12 |
162 | |
163 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.12). |
164 | |
165 | There were no changes made to Haml between versions 2.2.11 and 2.2.12. |
166 | |
167 | ## 2.2.11 |
168 | |
169 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.11). |
170 | |
171 | * Fixed a bug with XSS protection where HTML escaping would raise an error |
172 | if passed a non-string value. |
173 | Note that this doesn't affect any HTML escaping when XSS protection is disabled. |
174 | |
175 | * Fixed a bug in outer-whitespace nuking where whitespace-only Ruby strings |
176 | blocked whitespace nuking beyond them. |
177 | |
178 | * Use `ensure` to protect the resetting of the Haml output buffer |
179 | against exceptions that are raised within the compiled Haml code. |
180 | |
181 | * Fix an error line-numbering bug that appeared if an error was thrown |
182 | within loud script (`=`). |
183 | This is not the best solution, as it disables a few optimizations, |
184 | but it shouldn't have too much effect and the optimizations |
185 | will hopefully be re-enabled in version 2.4. |
186 | |
187 | * Don't crash if the plugin skeleton is installed and `rake gems:install` is run. |
188 | |
189 | * Don't use `RAILS_ROOT` directly. |
190 | This no longer exists in Rails 3.0. |
191 | Instead abstract this out as `Haml::Util.rails_root`. |
192 | This changes makes Haml fully compatible with edge Rails as of this writing. |
193 | |
194 | ## 2.2.10 |
195 | |
196 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.10). |
197 | |
198 | * Fixed a bug where elements with dynamic attributes and no content |
199 | would have too much whitespace between the opening and closing tag. |
200 | |
201 | * Changed `rails/init.rb` away from loading `init.rb` and instead |
202 | have it basically copy the content. |
203 | This allows us to transfer the proper binding to `Haml.init_rails`. |
204 | |
205 | * Make sure Haml only tries to enable XSS protection integration |
206 | once all other plugins are loaded. |
207 | This allows it to work properly when Haml is a gem |
208 | and the `rails_xss` plugin is being used. |
209 | |
210 | * Mark the return value of Haml templates as HTML safe. |
211 | This makes Haml partials work with Rails' XSS protection. |
212 | |
213 | ## 2.2.9 |
214 | |
215 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.9). |
216 | |
217 | * Fixed a bug where Haml's text was concatenated to the wrong buffer |
218 | under certain circumstances. |
219 | This was mostly an issue under Rails when using methods like `capture`. |
220 | |
221 | * Fixed a bug where template text was escaped when there was interpolation in a line |
222 | and the `:escape_html` option was enabled. For example: |
223 | |
224 | Foo < Bar #{"<"} Baz |
225 | |
226 | with `:escape_html` used to render as |
227 | |
228 | Foo &lt; Bar < Baz |
229 | |
230 | but now renders as |
231 | |
232 | Foo < Bar < Baz |
233 | |
234 | ### Rails XSS Protection |
235 | |
236 | Haml 2.2.9 supports the XSS protection in Rails versions 2.3.5+. |
237 | There are several components to this: |
238 | |
239 | * If XSS protection is enabled, Haml's {file:HAML_REFERENCE.md#escape_html-option `:escape_html`} |
240 | option is set to `true` by default. |
241 | |
242 | * Strings declared as HTML safe won't be escaped by Haml, |
243 | including the {file:Haml/Helpers.html#html_escape-instance_method `#html_escape`} helper |
244 | and `&=` if `:escape_html` has been disabled. |
245 | |
246 | * Haml helpers that generate HTML are marked as HTML safe, |
247 | and will escape their input if it's not HTML safe. |
248 | |
249 | ## 2.2.8 |
250 | |
251 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.8). |
252 | |
253 | * Fixed a potential XSS issue with HTML escaping and wacky Unicode nonsense. |
254 | This is the same as [the issue fixed in Rails](http://groups.google.com/group/rubyonrails-security/browse_thread/thread/48ab3f4a2c16190f) a bit ago. |
255 | |
256 | ## 2.2.7 |
257 | |
258 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.7). |
259 | |
260 | * Fixed an `html2haml` issue where ERB attribute values |
261 | weren't HTML-unescaped before being transformed into Haml. |
262 | |
263 | * Fixed an `html2haml` issue where `#{}` wasn't escaped |
264 | before being transformed into Haml. |
265 | |
266 | * Add `<code>` to the list of tags that's |
267 | {file:HAML_REFERENCE.md#preserve-option automatically whitespace-preserved}. |
268 | |
269 | * Fixed a bug with `end` being followed by code in silent scripts - |
270 | it no longer throws an error when it's nested beneath tags. |
271 | |
272 | * Fixed a bug with inner whitespace-nuking and conditionals. |
273 | The `else` et al. clauses of conditionals are now properly |
274 | whitespace-nuked. |
275 | |
276 | ## 2.2.6 |
277 | |
278 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.6). |
279 | |
280 | * Made the error message when unable to load a dependency for html2haml |
281 | respect the `--trace` option. |
282 | |
283 | * Don't crash when the `__FILE__` constant of a Ruby file is a relative path, |
284 | as apparently happens sometimes in TextMate |
285 | (thanks to [Karl Varga](http://github.com/kjvarga)). |
286 | |
287 | * Add "Sass" to the `--version` string for the executables. |
288 | |
289 | * Raise an exception when commas are omitted in static attributes |
290 | (e.g. `%p{:foo => "bar" :baz => "bang"}`). |
291 | |
292 | ## 2.2.5 |
293 | |
294 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.5). |
295 | |
296 | * Got rid of trailing whitespace produced when opening a conditional comment |
297 | (thanks to [Norman Clarke](http://blog.njclarke.com/)). |
298 | |
299 | * Fixed CSS id concatenation when a numeric id is given as an attribute. |
300 | (thanks to [Norman Clarke](http://blog.njclarke.com/)). |
301 | |
302 | * Fixed a couple bugs with using "-end" in strings. |
303 | |
304 | ## 2.2.4 |
305 | |
306 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.4). |
307 | |
308 | * Allow `end` to be used for silent script when it's followed by code. |
309 | For example: |
310 | |
311 | - form_for do |
312 | ... |
313 | - end if @show_form |
314 | |
315 | This isn't very good style, but we're supporting it for consistency's sake. |
316 | |
317 | * Don't add `require 'rubygems'` to the top of init.rb when installed |
318 | via `haml --rails`. This isn't necessary, and actually gets |
319 | clobbered as soon as haml/template is loaded. |
320 | |
321 | ## 2.2.3 |
322 | |
323 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.3). |
324 | |
325 | Haml 2.2.3 adds support for the JRuby bundling tools |
326 | for Google AppEngine, thanks to [Jan Ulbrich](http://github.com/ulbrich). |
327 | |
328 | ## 2.2.2 |
329 | |
330 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.2). |
331 | |
332 | Haml 2.2.2 is a minor bugfix release, with several notable changes. |
333 | First, {file:Haml/Helpers.html#haml_concat-instance_method `haml_concat`} |
334 | will now raise an error when used with `=`. |
335 | This has always been incorrect behavior, |
336 | and in fact has never actually worked. |
337 | The only difference is that now it will fail loudly. |
338 | Second, Ruby 1.9 is now more fully supported, |
339 | especially with the {file:HAML_REFERENCE.md#htmlstyle_attributes_ new attribute syntax}. |
340 | Third, filters are no longer escaped when the {file:HAML_REFERENCE.md#escape_html-option `:escape_html` option} |
341 | is enabled and `#{}` interpolation is used. |
342 | |
343 | ## 2.2.1 |
344 | |
345 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.1). |
346 | |
347 | Haml 2.2.1 is a minor bug-fix release. |
348 | |
349 | ## 2.2.0 |
350 | |
351 | [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.0). |
352 | |
353 | Haml 2.2 adds several new features to the language, |
354 | fixes several bugs, and dramatically improves performance |
355 | (particularly when running with {file:HAML_REFERENCE.md#ugly-option `:ugly`} enabled). |
356 | |
357 | ### Syntax Changes |
358 | |
359 | #### HTML-Style Attribute Syntax |
360 | |
361 | Haml 2.2 introduces a new syntax for attributes |
362 | based on the HTML syntax. |
363 | For example: |
364 | |
365 | %a(href="http://haml-lang.com" title="Haml's so cool!") |
366 | %img(src="/images/haml.png" alt="Haml") |
367 | |
368 | There are two main reasons for this. |
369 | First, the hash-style syntax is very Ruby-specific. |
370 | There are now [Haml implementations](http://en.wikipedia.org/wiki/Haml#Implementations) |
371 | in many languages, each of which has its own syntax for hashes |
372 | (or dicts or associative arrays or whatever they're called). |
373 | The HTML syntax will be adopted by all of them, |
374 | so you can feel comfortable using Haml in whichever language you need. |
375 | |
376 | Second, the hash-style syntax is quite verbose. |
377 | `%img{:src => "/images/haml.png", :alt => "Haml"}` |
378 | is eight characters longer than `%img(src="/images/haml.png" alt="Haml")`. |
379 | Haml's supposed to be about writing templates quickly and easily; |
380 | HTML-style attributes should help out a lot with that. |
381 | |
382 | Ruby variables can be used as attribute values by omitting quotes. |
383 | Local variables or instance variables can be used. |
384 | For example: |
385 | |
386 | %a(title=@title href=href) Stuff |
387 | |
388 | This is the same as: |
389 | |
390 | %a{:title => @title, :href => href} Stuff |
391 | |
392 | Because there are no commas separating attributes, |
393 | more complicated expressions aren't allowed. |
394 | You can use `#{}` interpolation to insert complicated expressions |
395 | in a HTML-style attribute, though: |
396 | |
397 | %span(class="widget_#{@widget.number}") |
398 | |
399 | #### Multiline Attributes |
400 | |
401 | In general, Haml tries to keep individual elements on a single line. |
402 | There is a [multiline syntax](#multiline) for overflowing onto further lines, |
403 | but it's intentionally awkward to use to encourage shorter lines. |
404 | |
405 | However, there is one case where overflow is reasonable: attributes. |
406 | Often a tag will simply have a lot of attributes, and in this case |
407 | it makes sense to allow overflow. |
408 | You can now stretch an attribute hash across multiple lines: |
409 | |
410 | %script{:type => "text/javascript", |
411 | :src => "javascripts/script_#{2 + 7}"} |
412 | |
413 | This also works for HTML-style attributes: |
414 | |
415 | %script(type="text/javascript" |
416 | src="javascripts/script_#{2 + 7}") |
417 | |
418 | Note that for hash-style attributes, the newlines must come after commas. |
419 | |
420 | #### Universal interpolation |
421 | |
422 | In Haml 2.0, you could use `==` to interpolate Ruby code |
423 | within a line of text using `#{}`. |
424 | In Haml 2.2, the `==` is unnecessary; |
425 | `#{}` can be used in any text. |
426 | For example: |
427 | |
428 | %p This is a really cool #{h what_is_this}! |
429 | But is it a #{h what_isnt_this}? |
430 | |
431 | In addition, to {file:HAML_REFERENCE.md#escaping_html escape} or {file:HAML_REFERENCE.md#unescaping_html unescape} |
432 | the interpolated code, you can just add `&` or `!`, respectively, |
433 | to the beginning of the line: |
434 | |
435 | %p& This is a really cool #{what_is_this}! |
436 | & But is it a #{what_isnt_this}? |
437 | |
438 | #### Flexible indentation |
439 | |
440 | Haml has traditionally required its users to use two spaces of indentation. |
441 | This is the universal Ruby style, and still highly recommended. |
442 | However, Haml now allows any number of spaces or even tabs for indentation, |
443 | provided: |
444 | |
445 | * Tabs and spaces are not mixed |
446 | * The indentation is consistent within a given document |
447 | |
448 | ### New Options |
449 | |
450 | #### `:ugly` |
451 | |
452 | The `:ugly` option is not technically new; |
453 | it was introduced in Haml 2.0 to make rendering deeply nested templates less painful. |
454 | However, it's been greatly empowered in Haml 2.2. |
455 | It now does all sorts of performance optimizations |
456 | that couldn't be done before, |
457 | and its use increases Haml's performance dramatically. |
458 | It's enabled by default in production in Rails, |
459 | and it's highly recommended for production environments |
460 | in other frameworks. |
461 | |
462 | #### `:encoding` {#encoding-option} |
463 | |
464 | This option specifies the encoding of the Haml template |
465 | when running under Ruby 1.9. It defaults to `Encoding.default_internal` or `"utf-8"`. |
466 | This is useful for making sure that you don't get weird |
467 | encoding errors when dealing with non-ASCII input data. |
468 | |
469 | ### Deprecations |
470 | |
471 | #### `Haml::Helpers#puts` |
472 | |
473 | This helper is being deprecated for the obvious reason |
474 | that it conflicts with the `Kernel#puts` method. |
475 | I'm ashamed I ever chose this name. |
476 | Use `haml_tag` instead and spare me the embarrassment. |
477 | |
478 | #### `= haml_tag` |
479 | |
480 | A lot of people accidentally use "`= haml_tag`". |
481 | This has always been wrong; `haml_tag` outputs directly to the template, |
482 | and so should be used as "`- haml_tag`". |
483 | Now it raises an error when you use `=`. |
484 | |
485 | ### Compatibility |
486 | |
487 | #### Rails |
488 | |
489 | Haml 2.2 is fully compatible with Rails, |
490 | from 2.0.6 to the latest revision of edge, 783db25. |
491 | |
492 | #### Ruby 1.9 |
493 | |
494 | Haml 2.2 is also fully compatible with Ruby 1.9. |
495 | It supports Ruby 1.9-style attribute hashes, |
496 | and handles encoding-related issues |
497 | (see [the `:encoding` option](#encoding-option)). |
498 | |
499 | ### Filters |
500 | |
501 | #### `:markdown` |
502 | |
503 | There are numerous improvements to the Markdown filter. |
504 | No longer will Haml attempt to use RedCloth's inferior Markdown implementation. |
505 | Instead, it will look for all major Markdown implementations: |
506 | [RDiscount](http://github.com/rtomayko/rdiscount), |
507 | [RPeg-Markdown](http://github.com/rtomayko/rpeg-markdown), |
508 | [Maruku](http://maruku.rubyforge.org), |
509 | and [BlueCloth](www.deveiate.org/projects/BlueCloth). |
510 | |
511 | #### `:cdata` |
512 | |
513 | There is now a `:cdata` filter for wrapping text in CDATA tags. |
514 | |
515 | #### `:sass` |
516 | |
517 | The `:sass` filter now uses options set in {Sass::Plugin}, |
518 | if they're available. |
519 | |
520 | ### Executables |
521 | |
522 | #### `haml` |
523 | |
524 | The `haml` executable now takes `-r` and `-I` flags |
525 | that act just like the same flags for the `ruby` executable. |
526 | This allows users to load helper files when using Haml |
527 | from the command line. |
528 | |
529 | It also takes a `--debug` flag that causes it to spit out |
530 | the Ruby code that Haml generates from the template. |
531 | This is more for my benefit than anything, |
532 | but you may find it interesting. |
533 | |
534 | #### `html2haml` |
535 | |
536 | The `html2haml` executable has undergone significant improvements. |
537 | Many of these are bugfixes, but there are also a few features. |
538 | For one, it now understands CDATA tags and autodetects ERB files. |
539 | In addition, a line containing just "`- end`" is now a Haml error; |
540 | since it's not possible for `html2haml` to properly parse all Ruby blocks, |
541 | this acts as a signal for the author that there are blocks |
542 | to be dealt with. |
543 | |
544 | ### Miscellaneous |
545 | |
546 | #### XHTML Mobile DTD |
547 | |
548 | Haml 2.2 supports a DTD for XHTML Mobile: `!!! Mobile`. |
549 | |
550 | #### YARD |
551 | |
552 | All the documentation for Haml 2.2, including this changelog, |
553 | has been moved to [YARD](http://yard.soen.ca). |
554 | YARD is an excellent documentation system, |
555 | and allows us to write our documentation in [Maruku](http://maruku.rubyforge.org), |
556 | which is also excellent. |