Exemple #1
0
 /// <summary>
 /// Creates HTML parser
 /// </summary>
 /// <param name="parsingMode">
 /// Parsing mode (HTML, XHTML or XML). HTML and XHTML differ in element
 /// and attribute name case-sensitity while XML mode treats &lt;script>
 /// and &lt;style elements as regular elements.
 /// </param>
 /// <param name="scriptTypeResolution">
 /// A service that helps parser to detemine if content of a &lt;script>
 /// block should be skipped over (normal behavior) or should parser
 /// continue parsing inside the block since block content is actually
 /// a markup, like in &lt;script type="text/x-handlebars-template">.
 /// </param>
 public HtmlParser(ParsingMode parsingMode, IHtmlScriptTypeResolutionService scriptTypeResolution, IHtmlScriptOrStyleTagNamesService scriptOrStyleTagNameService)
 {
     ParsingMode                 = parsingMode;
     ScriptTypeResolution        = scriptTypeResolution;
     ScriptOrStyleTagNameService = (scriptOrStyleTagNameService ?? new DefaultScriptOrStyleTagNameService());
     Stats = new HtmlParserStatistic();
 }
Exemple #2
0
 /// <summary>
 /// Creates HTML parser
 /// </summary>
 /// <param name="parsingMode">
 /// Parsing mode (HTML, XHTML or XML). HTML and XHTML differ in element
 /// and attribute name case-sensitity while XML mode treats &lt;script>
 /// and &lt;style elements as regular elements.
 /// </param>
 /// <param name="scriptTypeResolution">
 /// A service that helps parser to detemine if content of a &lt;script>
 /// block should be skipped over (normal behavior) or should parser
 /// continue parsing inside the block since block content is actually
 /// a markup, like in &lt;script type="text/x-handlebars-template">.
 /// </param>
 public HtmlParser(ParsingMode parsingMode, IHtmlScriptTypeResolutionService scriptTypeResolution, IHtmlScriptOrStyleTagNamesService scriptOrStyleTagNameService) {
     ParsingMode = parsingMode;
     ScriptTypeResolution = scriptTypeResolution;
     ScriptOrStyleTagNameService = (scriptOrStyleTagNameService ?? new DefaultScriptOrStyleTagNameService());
     Stats = new HtmlParserStatistic();
 }