Search code examples
rythm

unexpected whitespace handling in rythm removes wanted blanks


In the attempt to move from Freemarker to Rythm I am getting the effect that Rythm removes a lot of whitespace.

I am aware that there are @compact @nocompact and @escape options.I tried some of these but they seem to have no effect on the whitespace handling. According to http://rythmengine.org/doc/configuration.md#codegen_compact_enabled the default handling is compacting.

Rythm seems to remove whitespace that I actively try to insert e.g.

no whitespace here
@nocompact() {
  @for (int i=0;i<2;i++) {
    please keep the whitespace
  }
}
no whitespace here

will lead to

no whitespace here
 please keep the whitespace
please keep the whitespace
no whitespace here

effectively changing the whitespace to a single space.

How can the original whitespace setting be kept?

Is the non functioning nocompact() a bug?


Solution

  • I think it's a bug. Please fire an issue on https://github.com/greenlaw110/rythm/issues