Conversation
|
Strong +1 for this. I have some reasons for it.
Production applications are already ugly mode. Is there any use case we should care about template engine's rendering result? |
|
:+10000: from me! Removing the ugly mode is the first thing I did when I made my own Haml alternative (which was never publicly released). If no one disagrees, we can just drop the feature in the next major release. It's nonsense to print a deprecation warning for ugly mode users, so there's no way we can announce the removal beforehand. Thank you @teeparham for bringing this topic in a perfect timing! |
|
I pushed a Also we need to merge haml/haml-spec#13 & update the haml-spec project (it's a subproject of haml). |
|
👍 I hope this branch will be merged soon! |
|
This is almost ready. It has been rebased on the latest master. Thanks to @k0kubun for making this much easier by separating the pretty tests! There are still some failing tests:
|
With pretty mode, compiled code was: _hamlout.push_text("<p>foo</p>\n#{
_hamlout.format_script(( haml_concat 'foo'
),false,false,false,false,false,true,false);}\n<p>bar</p>\n", 0, false);;::Haml::Util.html_safe(_erbout)and the backtrace: And with your branch, compiled code is: _hamlout.buffer << ("<p>foo</p>\n".freeze);; _hamlout.buffer << (
( haml_concat 'foo'
).to_s);; _hamlout.buffer << ("\n<p>bar</p>\n".freeze);;::Haml::Util.html_safe(_erbout)And the backtrace is:
This test is too fragile. How about calling |
It seems that it's the current behavior. |
|
Thanks @k0kubun! This is ready except for the |
|
The git submodule update does not work since the To run the tests locally: git fetch origin pull/894/head:pr-894
git checkout pr-894
cd test/haml-spec/
git fetch origin pull/13/head:pr-13
git checkout pr-13
cd ../..
bundle exec rake |
|
@teeparham Just merged haml/haml-spec#13! |
|
@amatsuda It looks like haml/haml-spec#7 doesn't work with Rails 4.0. I think we need haml/haml-spec#10 instead. Otherwise, tests are passing. |
|
We could remove rails 4.0 from the test suite, since it's unsupported. |
|
@teeparham Ugh, sorry. Fixed haml-spec. |
|
@amatsuda Thank you. Tests are green! ✅ |
* Remove unused indent argument from push_merged_text
* Remove ugly argument from #format_script (Indentation to be fixed in the next commit. This makes the commit easier to understand.)
This has been obsolete since #894.
Now Haml doesn't have pretty mode haml/haml#894.
This option got dropped from haml. See haml/haml#894
This option got dropped from haml. See haml/haml#894
This option got dropped from haml. See haml/haml#894
This option got dropped from haml. See haml/haml#894
This option got dropped from haml. See haml/haml#894
This option got dropped from haml. See haml/haml#894
This option got dropped from haml. See haml/haml#894
This option got dropped from haml. See haml/haml#894
This option got dropped from haml. See haml/haml#894
I propose we remove the
:uglyoption. Haml should render all output as ugly, and never attempt to format pretty HTML. All modern browsers automatically pretty-format HTML. All modern text editors have tools to pretty-format HTML. There is no longer a need for Haml to do this.The benefits are speed and cleaner code.