TiddlyWiki5/core
pmario 005e175378 Fix RSOD when $tw.utils.addClass receives a class string with whitespace
PR #9251 replaced the manual setAttribute("class", ...) implementation of
$tw.utils.addClass/removeClass/toggleClass with direct Element.classList
calls. Unlike setAttribute, classList.add/remove/toggle throws
InvalidCharacterError on any token containing whitespace, so callers that
pass a whole class string (e.g. modal.js passing tiddler.fields.class)
now crash.

Manual repro on tw5-com: open SampleWizard, set the `class` field to
"aaa bbb", Done, open popup -> OK -> open nested popup -> RSOD.

Fix: split the className argument on whitespace in deprecated.js and feed
individual tokens to classList. A small splitClasses() helper keeps the
three functions symmetrical.

Adds adversarial regression tests in test-utils.js covering:
- ASCII whitespace variants (space, tab, CR, LF, mixed runs, padding)
- Unicode whitespace (U+00A0 non-breaking space)
- de-duplication across single and multiple calls
- remove/toggle no-op on missing tokens
- toggle with status undefined / true / false
- silent no-op for whitespace-only / empty / non-string / null input
- silent no-op when the element has no classList
2026-04-22 17:15:35 +02:00
..
images Remove flags in language plugins (#8837) 2025-02-21 12:17:53 +00:00
language Clarify wording of tiddler info cascade view 2026-04-12 14:33:52 +01:00
modules Fix RSOD when $tw.utils.addClass receives a class string with whitespace 2026-04-22 17:15:35 +02:00
palettes Muted palette, minor adjustments (#9015) 2025-10-29 11:18:31 +00:00
stylesheets Intergrate tiddlywiki palette colors and settings to custom CSS properties (#9333) 2026-02-04 11:37:04 +00:00
templates Revert #9554 Refactor stylesheets in single <style> tags 2026-01-18 11:40:10 +00:00
ui Revert "Use currentColor to style svg (#9316)" (#9799) 2026-04-10 12:23:07 +02:00
wiki Prepare for v5.5.0 2026-04-20 20:03:12 +01:00
acknowledgements.tid Migrate diff-match-patch to a modern fork (#9511) 2026-01-04 11:56:25 +00:00
copyright.tid Update for 2025 2025-01-05 14:35:27 +00:00
icon.tid Parameterise core icons (#7413) 2023-05-06 12:08:46 +01:00
plugin.info Add plugin stability badges (#8198) 2024-05-21 11:22:39 +01:00
readme.tid
sjcl-license.tid

title: $:/core/readme

This plugin contains TiddlyWiki's core components, comprising:

* JavaScript code modules
* Icons
* Templates needed to create TiddlyWiki's user interface
* British English (''en-GB'') translations of the localisable strings used by the core