mganss / HtmlSanitizer

Cleans HTML to avoid XSS attacks
MIT License
1.55k stars 200 forks source link

Add HtmlSanitizerOptions #359

Closed vanillajonathan closed 2 years ago

codecov[bot] commented 2 years ago

Codecov Report

Merging #359 (b21e34a) into master (874f1be) will increase coverage by 0.11%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #359      +/-   ##
==========================================
+ Coverage   94.32%   94.44%   +0.11%     
==========================================
  Files           4        5       +1     
  Lines         811      828      +17     
  Branches       85       85              
==========================================
+ Hits          765      782      +17     
  Misses         34       34              
  Partials       12       12              
Impacted Files Coverage Δ
src/HtmlSanitizer/HtmlSanitizer.cs 96.17% <100.00%> (+0.05%) :arrow_up:
src/HtmlSanitizer/HtmlSanitizerOptions.cs 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 874f1be...b21e34a. Read the comment docs.

mganss commented 2 years ago

Thanks for starting this. I'm wondering how the HtmlSanitizerOptions should tie in with the static DefaultAllowedTags etc. properties that are already in HtmlSanitizer. Should there be an additional DefaultOptions property or should it replace the individual properties? cc @tiesont

tiesont commented 2 years ago

Thanks for starting this. I'm wondering how the HtmlSanitizerOptions should tie in with the static DefaultAllowedTags etc. properties that are already in HtmlSanitizer. Should there be an additional DefaultOptions property or should it replace the individual properties? cc @tiesont

I think you'd wind up with a simpler process for setting up a sanitizer if this just completely replaces the existing properties.

vanillajonathan commented 2 years ago

I agree with @tiesont.

vanillajonathan commented 2 years ago

Sorry, I had forgot about this. It builds now.

mganss commented 2 years ago

Could you adapt the unit tests to cover the changes?

vanillajonathan commented 2 years ago

Now it says there is coverage.