-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Macros and indentation level inheritance #821
Comments
I don't think we offer control over this now, but it might be easy to change the behavior? On the other hand, not sure if that's always desirable, and if not, how we would spell configuring it. |
Definitely not.
My first thought would be EDIT: forgot |
Sounds somewhat reasonable. So we only allow this for macro definitions, right? @Kijewski @vallentin any thoughts? |
I can see why one would want this feature, not only in like in mataha's example, but in regular HTML output, too. I guess this would be reasonably simple to implement, at least if the indentation level was user supplied by some means. I don't think it would be feasible to figure out the indentation level automatically at compile time. Then |
What I've envisioned, though, is figuring out the indentation at compile time. Supplying it would require either some weird syntax (
|
We could do something like the whitespace after any newlines in the literal preceding the |
That solves my problem in full and - perhaps counterintuitively - is what I would expect. |
Well, all of these could happen:
In particular, this last one I think would repeat |
How about make it either:
|
@Kijewski any thoughts? Inventing a character sequence based on count seems way too magic. But I'm inclined to think the least magic behavior is that |
I don't see any advantage in counting white space characters. If I use tabs, spaces, and some odd unicode characters to indent my code, then this exact indentation should be replicated. In the end, I think everything between The only problem is if there are nodes |
I don't think we should make that a syntax error -- it would just only reproduce the whitespace after the
would reproduce |
Yeah, makes sense.
? |
Yup. |
That makes perfect sense. Just saying that at that point it's no longer "whitespace handling", of course. |
I think that's okay. Just needs good documentation. |
Say I have the following template:
Is it possible, somehow, to inherit indentation level for the contents of the macro so that the text inside is properly spaced? Right now, the resulting template will look like so:
Which is obviously not what I'm trying to achieve (see here for my use-case coupled with a flabbergasting workaround).
The text was updated successfully, but these errors were encountered: