C# 클래스 NExtends.Helpers.HtmlUtility

This is an HTML cleanup utility combining the benefits of the HtmlAgilityPack to parse raw HTML and the AntiXss library to remove potentially dangerous user input. Additionally it uses a list created by Robert Beal to limit the number of allowed tags and attributes to a sensible level
파일 보기 프로젝트 열기: LuccaSA/NExtends

공개 메소드들

메소드 설명
SanitizeHtml ( string source ) : string

Takes raw HTML input and cleans against a whitelist

StripHtml ( string source ) : string

Takes a raw source and removes all HTML tags

비공개 메소드들

메소드 설명
CleanChildren ( HtmlNode parent, string whitelist ) : void

Apply CleanNodes to each of the child nodes

CleanNodes ( HtmlNode node, string whitelist ) : void

Recursively delete nodes not in the whitelist

GetHtml ( string source ) : HtmlAgilityPack.HtmlDocument

Helper function that returns an HTML document from text

메소드 상세

SanitizeHtml() 공개 정적인 메소드

Takes raw HTML input and cleans against a whitelist
public static SanitizeHtml ( string source ) : string
source string Html source
리턴 string

StripHtml() 공개 정적인 메소드

Takes a raw source and removes all HTML tags
public static StripHtml ( string source ) : string
source string
리턴 string