Repository navigation
Collapse whitespace between adjacent TextNodes (#2347) - #2349
Conversation
00afc81 to
fe8cc29
Compare
|
I accidentally auto-formatted a file and introduced a bug during refactoring. These issues should both be fixed now. I'll take a look at the failing tests. I hadn't run all tests locally because I keep getting compilation errors in the java11 sources: |
|
Nevermind, mvn clean fixed the compilation errors. |
fe8cc29 to
94a29cc
Compare
|
The failing test case was |
|
Thanks, looks good! I simplified the impl to use the existing nextNonBlank method.
We actually used to do that something like that, by peeking into the last character of the Appender, and then not trimming leading. That only worked if the Appender was a StringBuilder. I guess we could track it now on QuiteAppender#append, but it seems likes a lot of overhead. I think this flow works well in the rest of the context of the pretty printer. |
Fixes #2347
I'm not sure if this can be fixed more elegantly than looping over sequential text nodes. I'd prefer handling multiple text nodes in a single call to
Entities.doEscape, but that would involve larger code changes.