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

Some newline characters are being removed #68

Closed
Aunmag opened this issue Jan 12, 2020 · 3 comments · Fixed by #90
Closed

Some newline characters are being removed #68

Aunmag opened this issue Jan 12, 2020 · 3 comments · Fixed by #90

Comments

@Aunmag
Copy link

Aunmag commented Jan 12, 2020

I have this template:

@()
Hello!@for n in &vec![0, 1, 2] {@if true {

The @n number.}}

Good bye!

I expected it would produce:

Hello!

The 0 number.

The 1 number.

The 2 number.

Good bye!

But there's no two last newline characters right before "Good bye!":

Hello!

The 0 number.

The 1 number.

The 2 number.Good bye!

rustc 1.39.0 (4560ea788 2019-11-04)
cargo 1.39.0 (1c6ec66d5 2019-09-30)
ructe 0.9.0

@kaj
Copy link
Owner

kaj commented Jan 16, 2020

Sounds strange and inconsistent. I'll look into it!

@Aunmag
Copy link
Author

Aunmag commented Jul 1, 2020

Any update?

@kaj
Copy link
Owner

kaj commented Jul 17, 2020

I've had a rather hectic spring without looking so much at ructe, but I'm looking now, and will have a PR ready shortly.

kaj added a commit that referenced this issue Jul 17, 2020
Fixes #68.

Whitespace was ignored after the closing brace of a for loop, which
was inconsistent with other blocks (where whitespace after the block
remains).

I might have introduced this bug intentionally way back, just to get
some less "junk" whitespace in my output. But that will have to be
solved in a more predictable and deterministic way at some later time.
@kaj kaj closed this as completed in #90 Jul 19, 2020
kaj added a commit that referenced this issue Aug 14, 2020
* PR #80 and #94: Support Tide framework by a feature and an example.
* PR #91: Update basic examples to edition 2018.
* Issue #68, PR #90: Don't eat whitespace after a for loop.
* Issue #66, PR #89: Fix parse error for nested braces in expressions.
* PR #84: Use std::ascii::escape_default.
* PR #87: Provide ToHtml::to_buffer()
* Forbid unsafe and undocumented code.
* The build is on https://travis-ci.com/kaj/ructe now.
* Internal cleanup.

Thanks to @Aunmag and @prabirshrestha for reported issues and
contributed code.
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 a pull request may close this issue.

2 participants