lukaszlenart opened a new pull request, #1743:
URL: https://github.com/apache/struts/pull/1743

   ## Summary
   
   In 7.2.0, `FreemarkerManager` disabled FreeMarker whitespace stripping 
whenever `devMode` was enabled (`whitespaceStripping && !devMode`). This 
regressed behavior versus 6.x and had two visible effects in development:
   
   - **`s:textarea` rendered blank lines** — the `<#if nameValue??>` / `</#if>` 
directive lines inside `<textarea>…</textarea>` were no longer collapsed, and 
whitespace there is *significant* page content, so an empty textarea showed up 
as blank lines on screen.
   - **Bloated HTML output** — every directive-only line across all UI 
templates emitted its newline/indentation.
   
   The `&& !devMode` term also overrode the 
`struts.freemarker.whitespaceStripping` setting, leaving developers no way to 
re-enable stripping while in devMode.
   
   This change makes whitespace stripping governed solely by 
`struts.freemarker.whitespaceStripping` (default `true`), restoring 6.x 
behavior by default while keeping an explicit opt-out. The now-unused `devMode` 
field/setter/injection (added in 7.2.0 only for this coupling) is removed, and 
the constant's Javadoc is updated.
   
   ## Changes
   
   - `FreemarkerManager`: drop the `&& !devMode` coupling; remove the dead 
`devMode` field, `setDevMode` setter and its `@Inject`.
   - `StrutsConstants`: remove the stale "Automatically disabled when devMode 
is enabled" note from `STRUTS_FREEMARKER_WHITESPACE_STRIPPING`.
   - Tests: remove the two devMode-coupling tests; keep default-on and 
explicit-off coverage.
   - Design + implementation plan docs under `docs/superpowers/`.
   
   ## Test Plan
   
   - [x] `mvn test -DskipAssembly -pl core -Dtest=FreemarkerManagerTest` — 
passes
   - [x] `mvn test -DskipAssembly -pl core -Dtest=TextareaTest` — passes 
(rendering guard)
   - [x] `mvn test -DskipAssembly -pl core` — full core module, 2969 tests, 0 
failures
   
   Fixes [WW-5256](https://issues.apache.org/jira/browse/WW-5256)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to