Opened 4 months ago

Last modified 4 months ago

#36353 closed New feature

Add `content` to `Script` media asset — at Initial Version

Reported by: Johannes Maron Owned by:
Component: Forms Version: 5.2
Severity: Normal Keywords:
Cc: Johannes Maron Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This is a follow-up to #35886

I noticed that the Script does support any attribute, but not a content or innerHTML.

Currently:

element_template = '<script src="{path}"{attributes}></script>'

Better:

element_template = '<script src="{path}"{attributes}>{content}</script>'

You might want to just drop a import "#myPackage" inside the script tag, to lead a file from your importmap.

This would look something like:

Script(type="module", content="import 'myPackage'")

I am not sure, if this is a bug, feature request or cleanup, someone should review the ticket type.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top