Repository navigation
Conversation
… against claimed elements) buttonAlign is interpolated into a class name, so an unrecognised value from either configuration path reached the markup. It is now coerced back to 'auto' in createDOM(), which covers constructor options and data-button-align alike. WaveformPlayer.init() only recognised its own data-waveform-initialized flag, so an element built programmatically but also carrying data-waveform-player was re-initialized by the next scan. It is now skipped by instance lookup. Both reported by @scruffian in #22. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Thanks Ben — you found two real things here, and I've landed both in 1.24.4, credited to you in the changelog:
I'm going to pass on the rest, though. Disabling auto-init for ESM/CJS is a breaking change for anyone doing The SVG sanitizer is the one I feel strongest about. If someone can write This library is framework-agnostic and I don't want to reshape its contract around one host's escaping model — but I appreciate you digging into it, and the two fixes above wouldn't have happened otherwise. Closing this in favour of what shipped; happy to look at anything else you hit. |
|
Thanks for the quick reply. What do you also think about adding validation for playback rates? |
|
Coming back to this: yes — and you were more right than the question implied. It wasn't just playback rates. Digging into That pattern turned out to be live in four packages. Shipped in 1.25.0: every option is now normalized once, on the merged result, so the constructor path, the Two related changes while I was in there: You're credited in the changelog. My position on the SVG sanitizer hasn't changed — that one's still an escaping problem in the host — but the validation question was the right one to push on, and none of the rest would have happened without it. Thanks for coming back to it. |
|
Thanks for your consideration and follow-ups on this, @arraypress! I opened #24 as a middle ground that avoids requiring the package to maintain an SVG sanitizer. Gutenberg only needs the core, programmatic player—not automatic declarative initialization. Exporting the core separately lets us initialize only the elements Gutenberg creates and controls, without scanning unrelated user-authored markup across the page. The existing default and CDN initialization behavior remains unchanged. This would be greatly useful for us. |
Summary
[data-waveform-player];WaveformPlayer.init()remains the explicit declarative path.data-play-icon/data-pause-iconSVG instead of inserting raw markup.playIconandpauseIcon.Why
Gutenberg allows users to supply arbitrary HTML in data attributes. We should guard against this by only allowing supported attributes. We also allow users of the module to initialize playlist players programmatically, while this package also supports declarative markup. This keeps both paths predictable without silently breaking existing declarative icon users.
Testing
npm testnpm run buildcc @arraypress