MtHaml icon indicating copy to clipboard operation
MtHaml copied to clipboard

First stab at improving whitespace handling.

Open chrisrichard opened this issue 10 years ago • 2 comments

These rules are helping in my case but still leave something to be desired. Unclear about the possibility of accessing rendered content of a previous sibling if statement, for eg.

chrisrichard avatar Apr 22 '14 16:04 chrisrichard

Great!

The "Printer" NodeVisitor may helper understanding how different nodes are used, depending on the input (see test/MtHaml/Tests/fixtures/parser/*.test for examples).

Also wondering about the feasibility of detecting whether a particular node is really the first child when there are conditional/loop statements as siblings. I assume this isn't easily/possible?

I can't figure a way of doing that reliably at compile time, sadly. This is possible at runtime, though. E.g. by using a filter to trim leading/trailing whitespaces, or outputing code that conditionally displays the leading linebreak.

arnaud-lb avatar Apr 25 '14 23:04 arnaud-lb

Related: #53

arnaud-lb avatar Jun 21 '14 10:06 arnaud-lb