← 输入框|github.com|刷新
Skip to content

fix(core): split className on any whitespace - #11577

Open
NathanWalker wants to merge 1 commit into
mainfrom
fix/multiline-class-names
Open

NathanWalker wants to merge 1 commit into
mainfrom
fix/multiline-class-names

Conversation

@NathanWalker

Copy link
Copy Markdown
Contributor

PR Checklist

What is the current behavior?

className is split with split(' '), so only single spaces separate classes. A class attribute that uses newlines or tabs, which Prettier 2.3+ produces when it wraps long class attributes in Vue and Angular templates, gives class names with the line breaks and indentation still attached (for example "\n font-bold"). Those match no selector, so the styles silently don't apply. Repeated spaces also add an empty class.

What is the new behavior?

className is split on any run of whitespace and empty entries are dropped, the same way browsers tokenize the class attribute.

The new spec ui/core/view-base/class-name.spec.ts covers spaces, newlines and tabs, repeated whitespace, and clearing. Two of its cases fail without the fix. The full core suite passes (555 tests).

Closes #9402.

@nx-cloud

nx-cloud Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 0a68fa6

Command Status Duration Result
nx test apps-automated -c=android ✅ Succeeded 3m 14s View ↗
nx run-many --target=test --configuration=ci --... ✅ Succeeded <1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-10-23 19:51:38 UTC

@pkg-pr-new

pkg-pr-new Bot commented Oct 23, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nativescript/core@11577
npm i https://pkg.pr.new/@nativescript/vite@11577
npm i https://pkg.pr.new/@nativescript/webpack@11577

commit: 0a68fa6

This branch has not been deployed

No deployments
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.

Nativescript Ignores CSS Class Names Separated By Newlines

1 participant