Skip to content

Complete TextArea coverage with caller-owned escaping - #51

Merged
joshbruce merged 2 commits into
mainfrom
cp-joshbruce-control-guidance-fixes
Oct 15, 2026
Merged

joshbruce merged 2 commits into
mainfrom
cp-joshbruce-control-guidance-fixes

Conversation

@joshbruce

@joshbruce joshbruce commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Complete the remaining TextArea coverage and documentation while preserving the existing library-wide contract: implementers own sanitization and escaping.

TextArea renders caller-supplied values unchanged, retaining the existing parser-consumed leading newline. It does not impose escaping flags, a character encoding, or invalid-character handling. Document caller responsibility, an illustrative application-side escaping call, the risk of unescaped closing textarea tags, and native CR/CRLF normalization. The implementation change is only a PHPDoc clarification; no runtime escaping change remains relative to main.

Add DOM-based tests for caller-escaped markup-like text, ampersands, quotes, entity syntax, different escaping flags, empty/populated values, whitespace/newlines, UTF-8, repeated rendering, and native rows/required/readonly/disabled attributes. Existing ControlGuidanceTest covers help preservation, string/object warnings, custom IDs, and single warning rendering.

The issue's safety criterion is interpreted under the caller-escaped usage contract, not as automatic sanitization of arbitrary raw input. This maintainer-directed clarification is recorded in #45 (comment).

Validation: composer production passed on PHP 8.5.2 (source style, PHPStan, and 186 tests / 1,747 assertions, without warnings). git --no-pager diff --check passed.

List of issues fixed

Fixes #45

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@joshbruce joshbruce changed the title Complete TextArea value encoding and acceptance coverage Complete TextArea coverage with caller-owned escaping Oct 15, 2026
@joshbruce
joshbruce merged commit 4b2b0a9 into main Oct 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a Forms\TextArea component with label, value, and warning associations

1 participant