|
|
@ -10,21 +10,15 @@ namespace Xceed.Wpf.Toolkit.Core.Html |
|
|
{ |
|
|
{ |
|
|
public class HtmlEncodedTextWriter : XmlTextWriter |
|
|
public class HtmlEncodedTextWriter : XmlTextWriter |
|
|
{ |
|
|
{ |
|
|
private readonly XmlTextWriter _textWriter; |
|
|
public HtmlEncodedTextWriter(TextWriter w) : base(w) { } |
|
|
|
|
|
|
|
|
public HtmlEncodedTextWriter(TextWriter w) : base(w) |
|
|
|
|
|
{ |
|
|
|
|
|
_textWriter = this; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#region Overrides of XmlTextWriter
|
|
|
#region Overrides of XmlTextWriter
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
/// <inheritdoc />
|
|
|
public override void WriteString(string text) |
|
|
public override void WriteString(string text) |
|
|
{ |
|
|
{ |
|
|
text = WebUtility.HtmlEncode(text); |
|
|
text = WebUtility.HtmlEncode(text); |
|
|
_textWriter.WriteRaw(text); |
|
|
WriteRaw(text); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#endregion
|
|
|
#endregion
|
|
|
|