Skip to content

Jinja variables in hrefs are HTML encoded. Outside of hrefs they're not encoded. #72

@skyler

Description

@skyler

Premailer version 2.5.0.

I have an HTML template with Jinja variables in it. I'd like for these Jinja variables to remain after using premailer, so I can cache the premailed version and do variable substitution in a loop.

For variables in hrefs, like
<a href="{{ SURVEY_LINK }}" class="btn-primary">Start Survey</a>

Premailer HTML encodes the braces to their HTML-encoded entities:
<a href="%7B%7B%20SURVEY_LINK%20%7D%7D" class="btn-primary"...

Likewise, brackets, [ and ] in href quotes are escaped, which is problematic for my use case as well.

I'd like to use premailer on my Jinja email templates but because of this HTML encoding issue I'm not able to.

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