Skip to content

CSS url() with embed data surrounded by quotation marks is imporperly rendered  #35

@lysyloren

Description

@lysyloren

When someone embed data in CSS using url() and surrounds it with quotation marks " or ', django_static wrongly prepend current file path data. Example:

background-image: url("data:image/png;base64,...")

is rendered to:

background-image:url("/core/css/data:image/png;base64,...")

Proposed fix is to improve regexp in templatetags/django_static.py to this one:

REFERRED_CSS_URLS_REGEX = re.compile('''url\(((?!["']+data:)[^\)]+)\)''')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions