Skip to content
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

First stab at improving whitespace handling. #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chrisrichard
Copy link

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.

@arnaud-lb
Copy link
Owner

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
Copy link
Owner

Related: #53

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, fo eg.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants