Skip to content

Conversation

jonathan-s
Copy link
Collaborator

Removing one xfail which didn't use autoescape. (though that test still fails, leaving this as a draft while I ponder on why).

@jonathan-s jonathan-s changed the title Draft: Remove one xfail for addslashes that actually didn't use autoescape Draft: Remove one xfail for addslashes that didn't use autoescape Feb 16, 2025
Copy link

codecov bot commented Feb 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.99%. Comparing base (ee5481f) to head (fff4548).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #57      +/-   ##
==========================================
- Coverage   98.53%   93.99%   -4.55%     
==========================================
  Files          32       14      -18     
  Lines        5066     4544     -522     
  Branches     1718        0    -1718     
==========================================
- Hits         4992     4271     -721     
- Misses         64      273     +209     
+ Partials       10        0      -10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@LilyFirefly
Copy link
Owner

(though that test still fails, leaving this as a draft while I ponder on why).

I think this might be an ordering thing - is the variable being html escaped before having slashes added, where it should be slashes first and then html escaping?

@jonathan-s
Copy link
Collaborator Author

jonathan-s commented Feb 23, 2025

(though that test still fails, leaving this as a draft while I ponder on why).

I think this might be an ordering thing - is the variable being html escaped before having slashes added, where it should be slashes first and then html escaping?

You are correct.

            Some(content) => content
                .render(context)? <- culprit is here. 
                .replace(r"\", r"\\")
                .replace("\"", "\\\"")

Though tests still not happy...

E       assert "<a>\\' <a>\\'" == "&lt;a&gt;\\&#x27; <a>\\'"
E
E         - &lt;a&gt;\&#x27; <a>\'
E         + <a>\' <a>\'

Leaving this to ponder a bit more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants