Problem/Motivation
See #2567743-16: Add protocol filtering to the core Attribute component, which use modifies <drupal-render-placeholder callback=… arguments=… token=…> to <drupal-render-placeholder data-callback=… arguments=… token=…>.
The problem with that can be found in the accompanying comment:
// Generate placeholder markup. Note that the only requirement is that this
// is unique markup that isn't easily guessable. The #lazy_builder callback
// and its arguments are put in the placeholder markup solely to simplify
// debugging.
Prefixing it with data- makes it less developer-friendly.
Proposed resolution
This could (and IMO should) just not use Attribute, and do a SafeString::create(). This is internal in the Renderer anyway.
Remaining tasks
Review.
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 2569371-2.patch | 1.91 KB | wim leers |
Comments
Comment #2
wim leersComment #3
catchYep, that's a better change, no need to run that through Attributes the whole point is this is hardcoded.
Comment #4
alexpottNice - and it'll make it easier to convert SafeMarkup::format() to return an object like t() too.
Committed 4a7ffc9 and pushed to 8.0.x. Thanks!
Comment #6
dawehnerCan we trust those arguments?
Comment #8
berdirLooks like the new generated placeholders break when parsed as XML: #2593481: PlaceholderGenerator::createPlaceholder() generates invalid markup; causes placeholders to not be replaced if processed by DOMDocument