While working on the port of the Entity Embed filter's test coverage to core in #2940029: Add an input filter to display embedded Media entities, I realized that instead of the fairly complicated logic that #3063801: Only attach `entity_embed/caption` asset library when an entity was actually rendered added, we could just use #attached.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3063824-2.patch | 1.77 KB | wim leers |
Comments
Comment #2
wim leersComment #3
oknateRTBC.
Note, the library is always added even when there isn't a caption. But it's one css rule currently and doesn't break anything. Also, this was true before.
There isn't much value is checking for the availability of the caption since the one css rule doesn't break anything.
Comment #4
oknateComment #5
wim leersCorrect. By the way, attaching it only when there is a caption is impossible, because a filter is not informed which other filters are enabled for a given text format.
Comment #6
wim leersComment #8
wim leers🚢