Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#27400 closed Cleanup/optimization (fixed)

Changed in 1.10: {% static %} tag now encodes "#"

Reported by: no Owned by: Henry Dang
Component: Documentation Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

As of 1.10, the static tag will now encode "#" as "%23" causing the url to break.

example usecase:

<svg>
    <use xlink:href="{% static 'path/to/img.svg#whichimg' %}"></use>
</svg>

will become:

<svg>
    <use xlink:href="/static/path/to/img.svg%23whichimg"></use>
</svg>

which is incorrect, whereas prior to 1.10, the link would have read "/static/path/to/img.svg#whichimg"

In the very least, this should have been documented as a backward incompatible change.

Change History (5)

comment:1 by Tim Graham, 8 years ago

Component: Template systemDocumentation
Easy pickings: set
Summary: Regression in 1.10 static tag, now encodes "#"Changed in 1.10: {% static %} tag now encodes "#"
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

Bisected to cf546e11ac76c8dec527e39ff8ce8249a195ab42. As far as I know, there's no reason to put fragments in the static tag. Accepting as something to mention in the 1.10 release notes.

comment:2 by Henry Dang, 8 years ago

Owner: changed from nobody to Henry Dang
Status: newassigned

comment:3 by Tim Graham, 8 years ago

Has patch: set

comment:4 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In 9c2e1ad:

Fixed #27400 -- Documented {% static %} encoding change in 1.10.

comment:5 by Tim Graham <timograham@…>, 8 years ago

In 157607cb:

[1.10.x] Fixed #27400 -- Documented {% static %} encoding change in 1.10.

Backport of 9c2e1ad6a5f0ca98d68df7afdb13715921949c5a from master

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