-
-
Notifications
You must be signed in to change notification settings - Fork 500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improper indentation when using code blocks #507
Comments
May also be related with #440 |
The pretty renderer is not working well under some circumstances since Slim's focus lies on performance. If you have time please provide patches for the pretty renderer of the temple project https://github.com/judofyr/temple and also provide test cases. |
FYI: The intention was for Temple to ship with three HTML modes:
As of today, the current Pretty renderer is working as what PrettyFast was On Monday, May 19, 2014, Daniel Mendler notifications@github.com wrote:
// Magnus Holm |
Yes, but Pretty (as you name it PrettyFast) is enough. If you need PrettyPretty just use Nokogiri or some other library to reindent. However this doesn't mean that some easy to fix issues in Pretty mode should just stay there. |
fixed in temple master |
Hi,
I switched my project to Slim from Haml, Slim has more intuitive syntax and is faster than Haml, but the Pretty renderer is little buggy. My customer requires that HTML output must be intended for readability purposes, so this bug is a deal-breaker for me. I use Nestive gem (https://github.com/rwz/nestive) to manage layout inheritance and extendable areas. Nestive provides an
area
helper which allows to replace or extend rendered content.This is example Slim code from real world application:
And Slim configuration options:
Unfortunately, output code have broken indentation:
As you can see, all lines following
area
have a 6 spaces indentation relative to<head>
tag. The same code in HAML works as expected, providing proper indent:Output:
Things get even more messed if I want to append or prepend code to
area
function. With this code:Slim output is:
When HAML again have a proper indents:
Is there any solution to this problem? I admit that I like Slim more than Haml and want to use it in all my projects, but this bug leaves me with a choise to monkey-patch Pretty renderer or switch back to Haml.
The text was updated successfully, but these errors were encountered: