You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm using HtmlSanitizer for markup sanitizing and after library update from 5.x to 8.x & sign in URLs got escaped.
The problem is that I can't catch where it happens.
I have the following code:
var gj = new HtmlSanitizer
{
OutputFormatter = HtmlMarkupFormatter.Instance,
AllowDataAttributes = true
};
gj.Sanitize("<img src='http://foobar.com?x=5&y-6'>")
Outputs is: <img src="http://foobar.com?x=5&y-6"> - & appeared.
Yes, indeed. I'm ok to escape it, but I would like to have a chance to fix it somehow, at least in events. 'FilterUrl' event seems the most logical place, but at the moment event fires url is still unescaped.
For now I wrote the following fix using custom OutputFormatter: https://dotnetfiddle.net/wbtvUI, but let me know if there is another way to catch escaped values in events.
Hi, I'm using HtmlSanitizer for markup sanitizing and after library update from 5.x to 8.x
&
sign in URLs got escaped.The problem is that I can't catch where it happens.
I have the following code:
Outputs is:
<img src="http://foobar.com?x=5&y-6">
-&
appeared.I tried to do the following:
So in this event both variables are the same, so no chance of fixing it at this stage.
Ok, I tried the following:
So even post process event doesn't have this node escaped. Same is actual for
PostProcessNode
event.What can I do else to get back URLs in src/href attributes to it's original unescaped value?
The text was updated successfully, but these errors were encountered: