Author:ptrace Comitter:ptrace Date:2026-01-08 06:55:25 UTC Merge: e16278d468d378be781c11187b6212300029926f 44d2f695f546775703f7c2cfd051b4d90cfc07cc

Merge pull request 'After a loop, an extra newline got appended. This behavior is now fixed' (#1) from fix/extra-newline-after-loop into main

Reviewed-on: https://codeberg.org/ptrace/htmltemplate-jai/pulls/1

diff --git a/README.md b/README.md index 1eb5a3d..f66102d 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,6 @@ Output: <li><a href="#Foo">Foo</a>Bar</li> <li><a href="#Fizz">Fizz</a>Buzz</li> <li><a href="#contact">contact</a></li>     </ul> </div> ``` diff --git a/htmltemplate/lib.jai b/htmltemplate/lib.jai index bc406b3..714452e 100644 --- a/htmltemplate/lib.jai +++ b/htmltemplate/lib.jai @@ -284,7 +284,8 @@ handle_loop :: (value: [][]string, token: Token) -> string {         replaced := handle_replace(it, token);         bail("");         append(*buf, replaced);         append(*buf, "\n");         if it_index != value.count-1 then append(*buf, "\n");     }     out := builder_to_string(*buf); diff --git a/test/test.jai b/test/test.jai index 3751123..4bcc6ce 100644 --- a/test/test.jai +++ b/test/test.jai @@ -147,6 +147,7 @@ main :: () { <a href="#link1" target="_blank">My Link 1</a> <a href="#link2" >My Link 2</a>             STR_END;         test.expected.count -= 1;         test_run_and_store_result(test_html);     } @@ -247,6 +248,8 @@ main :: () { <h1><span><span class="D">D_D_D_D_%_D_D_D_D</span></span></h1>         STR_END;         test.expected.count -= 1;         test_run_and_store_result(test_html);     }