#36353: Add `content` to `Script` media asset
-------------------------------------+-------------------------------------
     Reporter:  Johannes Maron       |                     Type:
                                     |  Cleanup/optimization
       Status:  new                  |                Component:  Forms
      Version:  5.2                  |                 Severity:  Normal
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
 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.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36353>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/010701966ed06a4c-e58c1a83-b22b-458c-982e-90cd45c844ac-000000%40eu-central-1.amazonses.com.

Reply via email to