This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When choosing Source -> Format in an ERB file the formatter correctly indents the source and the '<%' and '<%=' but it also incorrectly indents '%' characters. The % is only a valid ERB escape character when it is the first character on the line, so after a source format the template is no longer valid. Correct behaviour would be to either ignore lines that start with %, or even better would be to indent the space after the %.
I just noticed that this same bug exhibits in another way: when a line starts with whitespace and then a '%' the editor assumes the rest of the line is Ruby and colors it accordingly, even though it will be interpreted as HTML
Thanks for the report, I hope I'll have time to fix this for 6.8.
The issue is still there.