Skip to content

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

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:)[^\)]+)\)''')

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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