Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Marko Marjanović committed May 12, 2021
1 parent d3ad8d0 commit 4bea14b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions AjaxControlToolkit/HtmlEditorExtender/HtmlEditorExtender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ public string Decode(string value) {
var hrefCharacters = "^\\\"\\>\\<\\\\";
result = Regex.Replace(result, "(?:\\&lt\\;|\\<)(\\/?)(a(?:(?:\\shref\\=\\\"[" + hrefCharacters + "]*\\\")|(?:\\sstyle\\=\\\"[" + attributeCharacters + "]*\\\"))*)(?:\\&gt\\;|\\>)", "<$1$2>", RegexOptions.IgnoreCase | RegexOptions.ECMAScript);

result = Regex.Replace(result, "&?lt;", "<");
result = Regex.Replace(result, "&?gt;", ">");
result = Regex.Replace(result, "&lt;", "<");
result = Regex.Replace(result, "&gt;", ">");

result = Regex.Replace(result, "&amp;", "&", RegexOptions.IgnoreCase);
result = Regex.Replace(result, "&nbsp;", "\xA0", RegexOptions.IgnoreCase);
Expand Down
2 changes: 1 addition & 1 deletion AjaxControlToolkit/Scripts/HtmlEditorExtender.js
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype = {
html = html.replace(/\<(\/?)strong\>/gi, '<$1b>').replace(/\<(\/?)em\>/gi, '<$1i>');

//encode for safe transport
html = html.replace(/&(?!g|lt;)/ig, '&amp;').replace(/\xA0/ig, '&nbsp;');
html = html.replace(/&/ig, '&amp;').replace(/\xA0/ig, '&nbsp;');
html = html.replace(/</ig, '&lt;').replace(/>/ig, '&gt;').replace(/\'/ig, '&apos;').replace(/\"/ig, '&quot;');

return html;
Expand Down
Loading

0 comments on commit 4bea14b

Please sign in to comment.