mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Fix wording in reference
This commit is contained in:
parent
9264a06497
commit
59fa14846a
1 changed files with 9 additions and 12 deletions
21
REFERENCE.md
21
REFERENCE.md
|
@ -79,18 +79,17 @@ On production environemnt, :ugly mode is used and Hamlit currently supports only
|
|||
So you'll see difference rendering result on development environment, but it'll be the same on production.
|
||||
|
||||
### No Haml buffer
|
||||
Hamlit uses Array as buffer for performance. So you can't touch Haml::Buffer from template when using Hamlit.
|
||||
Hamlit uses `Array` as buffer for performance. So you can't touch Haml::Buffer from template when using Hamlit.
|
||||
|
||||
### Haml helpers are still in development
|
||||
At the same time, because some methods in Haml::Buffer requires Haml::Buffer, they are not supported now.
|
||||
At the same time, because some methods in `Haml::Helpers` require `Haml::Buffer`, they are not supported now.
|
||||
But some helpers are supported on Rails. Some of not-implemented methods are planned to be supported.
|
||||
|
||||
### Limited attributes hyphenation
|
||||
In Haml, `%a{ foo: { bar: 'baz' } }` is rendered as `<a foo-bar='baz'></a>`, whatever foo is.
|
||||
In Hamlit, this feature is supported only for data attribute. Hamlit renders `%a{ data: { foo: 'bar' } }`
|
||||
as `<a data-foo='bar'></a>` because it's data attribute.
|
||||
|
||||
This design allows us to reduce work on runtime and is originally in [Faml](https://github.com/eagletmt/faml).
|
||||
as `<a data-foo='bar'></a>` because it's data attribute. This design allows us to reduce work on runtime
|
||||
and the idea is originally in [Faml](https://github.com/eagletmt/faml).
|
||||
|
||||
### Limited boolean attributes
|
||||
In Haml, `%a{ foo: false }` is rendered as `<a></a>`, whatever `foo` is.
|
||||
|
@ -99,13 +98,11 @@ http://www.w3.org/TR/xhtml1/guidelines.html or https://html.spec.whatwg.org/.
|
|||
The list is the same as `ActionView::Helpers::TagHelper::BOOLEAN_ATTRIBUTES`.
|
||||
In addition, data-\* is also regarded as boolean.
|
||||
|
||||
Since foo is not boolean attribute, `%a{ foo: false }` is rendered as `<a foo='false'></a>` (`foo` is not removed).
|
||||
This is the same behavior as Rails helpers.
|
||||
|
||||
Also for `%a{ foo: nil }`, Hamlit does not remove non-boolean attributes and render `<a foo=''></a>`.
|
||||
This design allows us to reduce String concatenation.
|
||||
|
||||
This is the largest difference between Hamlit and Faml.
|
||||
Since `foo` is not boolean attribute, `%a{ foo: false }` is rendered as `<a foo='false'></a>`
|
||||
This is the same behavior as Rails helpers. Also for `%a{ foo: nil }`,
|
||||
Hamlit does not remove non-boolean attributes and render `<a foo=''></a>`
|
||||
(`foo` is not removed). This design allows us to reduce string concatenation and
|
||||
is the only difference between Faml and Hamlit.
|
||||
|
||||
## 5 Types of Attributes
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue