Skip to content

4.x: parse shortcode attributes without creating DOM nodes; match names with digits (#11) - #14

Merged
micschk merged 3 commits into
v4from
fix/attribute-parsing-v4
Nov 2, 2026
Merged

micschk merged 3 commits into
v4from
fix/attribute-parsing-v4

Conversation

@micschk

@micschk micschk commented Nov 2, 2026

Copy link
Copy Markdown
Member

Release 4.0.18. Backport of the two JS fixes in #13.

The 4.x branch has no tests or CI of its own. main's selection, names, dialog and editor-placeholder specs were run locally against this checkout on a Silverstripe 5 host: 3 failing on a114686 (the selection handler spec and both names specs), 10/10 green after. Not tested: Silverstripe 4 / TinyMCE 4, and simpler 0.x (the host had simpler 1.0.4).

Pair-programmed with my buddy Claude

Backport from main. getCurrentEditorSelectionAsParsedShortcodeData() read a selected shortcode's
attributes by building it as an element with jQuery, in the live CMS document. They are now
parsed in an inert document (document.implementation.createHTMLDocument) under a fixed tag name;
values, entities and lower-cased names come out as before. placeholdersToShortcodes() uses the
same inert document. dist rebuilt.

4.x has no browser tests of its own: main's selection and dialog specs were run against this
checkout on a Silverstripe 5 host (must-fail first on a114686, then green).

Pair-programmed with my buddy Claude
Backport from main. Names are matched as ShortcodeParser does, \w+ ending at whitespace or ']',
so [year2] is no longer taken for [year] and saved back as [year 2], [button-large] no longer
matches button, a registered name with a digit gets its placeholder, and a shortcode without
attributes has no trailing space in its placeholder title. dist rebuilt.

Verified with main's names spec on a Silverstripe 5 host (must-fail first, then green).

Pair-programmed with my buddy Claude
Pair-programmed with my buddy Claude
@micschk
micschk merged commit 51f7f36 into v4 Nov 2, 2026
@micschk
micschk deleted the fix/attribute-parsing-v4 branch November 2, 2026 16:25
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.

1 participant