jetzig-framework / zmpl

Zmpl is a templating language written in Zig
MIT License
103 stars 8 forks source link

(closes #8) Multi-line tags and strings #9

Closed bobf closed 8 months ago

bobf commented 8 months ago

Add support for multi-line tags and strings in markup (non-Zig) chunks:

<div foo="bar"
     bar="baz"
     qux="foo bar baz
          qux quux corge">hello</div>

Re-work parser to work char by char instead of line by line.

Also fixes some bugs with missing blank lines (tests were incorrect).

Thanks @dhrubrawat66 for raising this one.

bobf commented 7 months ago

@Trundle Thanks for the review, I just pushed a commit to main that includes a template with DOS linebreaks, we just normalize to \n now so all the \r\n special-case code has gone.

Maybe we'll convert back to \r\n on Windows if people are using Zmpl directly to generate HTML they want to edit manually ? I think low priority, maybe just wait for somebody to ask for it.