Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter.escape should not escape SafeString #618

Closed
atian25 opened this issue Dec 20, 2015 · 3 comments
Closed

filter.escape should not escape SafeString #618

atian25 opened this issue Dec 20, 2015 · 3 comments
Labels

Comments

@atian25
Copy link
Contributor

atian25 commented Dec 20, 2015

https://github.com/mozilla/nunjucks/blob/master/src%2Ffilters.js#L118

    escape: function(str) {
        if(typeof str === 'string' ||
           str instanceof r.SafeString) {
            return lib.escape(str);
        }
        return str;
    },
@atian25
Copy link
Contributor Author

atian25 commented Dec 20, 2015

cc @carljm

@atian25 atian25 changed the title filter.escape should not escape SafeString filter.escape will escape SafeString, is it a feature or bug? Dec 20, 2015
@carljm
Copy link
Contributor

carljm commented Dec 22, 2015

I think this is a bug. In Jinja2, {{ "foo & bar"|safe|escape }} does not escape the ampersand.

@carljm carljm added the bug label Dec 22, 2015
@carljm carljm changed the title filter.escape will escape SafeString, is it a feature or bug? filter.escape will escape SafeString Dec 22, 2015
@carljm carljm changed the title filter.escape will escape SafeString filter.escape should not escape SafeString Dec 22, 2015
@atian25
Copy link
Contributor Author

atian25 commented Dec 27, 2015

@carljm PR: #623

@carljm carljm closed this as completed in d0a7e11 Jan 6, 2016
carljm added a commit that referenced this issue Mar 17, 2016
filter.escape should not escape SafeString, close #618
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants