C# 클래스 Tp.Web.Extensions.Components.PlainTextRenderer

A specialized sanitizer which outputs formatted plain text instead of HTML.
The renderer removes extra whitespace, and converts block level HTML elements to lines of plain text.
상속: Sanitizer
파일 보기 프로젝트 열기: TargetProcess/Tp.HelpDesk 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
_newLineStarted bool
_whiteSpaceStarted bool

공개 메소드들

메소드 설명
RenderToPlainText ( string input ) : string

Converts HTML to plain text.

Warning, the returned text may contain HTML fragments!!! For example, the original HTML code is: <p>&lt;hello&lt;>/p> Then, the converted text will be: <hello> So if you intend to output the stripped text in HTML, you need encode it first!

보호된 메소드들

메소드 설명
After ( TextWriter result ) : void
Before ( TextWriter result ) : void
RenderText ( TextWriter result, string value ) : void
StartNewLine ( TextWriter result ) : void
WriteCData ( TextWriter result, string value ) : void
WriteElement ( TextWriter result, string name, StringDictionary attributes, bool empty ) : void
WriteEndElement ( TextWriter result, string name ) : void
WriteString ( TextWriter result, string value ) : void

메소드 상세

After() 보호된 메소드

protected After ( TextWriter result ) : void
result System.IO.TextWriter
리턴 void

Before() 보호된 메소드

protected Before ( TextWriter result ) : void
result System.IO.TextWriter
리턴 void

RenderText() 보호된 메소드

protected RenderText ( TextWriter result, string value ) : void
result System.IO.TextWriter
value string
리턴 void

RenderToPlainText() 공개 정적인 메소드

Converts HTML to plain text.
Warning, the returned text may contain HTML fragments!!! For example, the original HTML code is: <p>&lt;hello&lt;>/p> Then, the converted text will be: <hello> So if you intend to output the stripped text in HTML, you need encode it first!
public static RenderToPlainText ( string input ) : string
input string Input HTML. May be null.
리턴 string

StartNewLine() 보호된 메소드

protected StartNewLine ( TextWriter result ) : void
result System.IO.TextWriter
리턴 void

WriteCData() 보호된 메소드

protected WriteCData ( TextWriter result, string value ) : void
result System.IO.TextWriter
value string
리턴 void

WriteElement() 보호된 메소드

protected WriteElement ( TextWriter result, string name, StringDictionary attributes, bool empty ) : void
result System.IO.TextWriter
name string
attributes System.Collections.Specialized.StringDictionary
empty bool
리턴 void

WriteEndElement() 보호된 메소드

protected WriteEndElement ( TextWriter result, string name ) : void
result System.IO.TextWriter
name string
리턴 void

WriteString() 보호된 메소드

protected WriteString ( TextWriter result, string value ) : void
result System.IO.TextWriter
value string
리턴 void

프로퍼티 상세

_newLineStarted 보호되어 있는 프로퍼티

If new line has already been written.
protected bool _newLineStarted
리턴 bool

_whiteSpaceStarted 보호되어 있는 프로퍼티

Whether currently outputing whitespace.
protected bool _whiteSpaceStarted
리턴 bool