本文整理汇总了C#中TidyNet.Lexer.PopInline方法的典型用法代码示例。如果您正苦于以下问题:C# Lexer.PopInline方法的具体用法?C# Lexer.PopInline怎么用?C# Lexer.PopInline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TidyNet.Lexer
的用法示例。
在下文中一共展示了Lexer.PopInline方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Parse
//.........这里部分代码省略.........
else if ((node.Tag.Model & ContentModel.Deflist) != 0)
{
lexer.UngetToken();
node = lexer.InferredTag("dl");
lexer.excludeBlocks = true;
}
else if ((node.Tag.Model & (ContentModel.Table | ContentModel.Rowgrp | ContentModel.Row)) != 0)
{
lexer.UngetToken();
node = lexer.InferredTag("table");
lexer.excludeBlocks = true;
}
else
{
/* AQ: The following line is from the official C
version of tidy. It doesn't make sense to me
because the '!' operator has higher precedence
than the '&' operator. It seems to me that the
expression always evaluates to 0.
if (!node->tag->model & (CM_ROW | CM_FIELD))
AQ: 13Jan2000 fixed in C tidy
*/
if (!((node.Tag.Model & (ContentModel.Row | ContentModel.Field)) != 0))
{
lexer.UngetToken();
return;
}
/* ignore </td> </th> <option> etc. */
continue;
}
}
if (node.Type == Node.EndTag)
{
if (node.Tag == tt.TagBr)
{
node.Type = Node.StartTag;
}
else if (node.Tag == tt.TagP)
{
Node.CoerceNode(lexer, node, tt.TagBr);
Node.InsertNodeAtEnd(body, node);
node = lexer.InferredTag("br");
}
else if ((node.Tag.Model & ContentModel.Inline) != 0)
{
lexer.PopInline(node);
}
}
if (node.Type == Node.StartTag || node.Type == Node.StartEndTag)
{
if (((node.Tag.Model & ContentModel.Inline) != 0) && !((node.Tag.Model & ContentModel.Mixed) != 0))
{
/* HTML4 strict doesn't allow inline content here */
/* but HTML2 does allow img elements as children of body */
if (node.Tag == tt.TagImg)
{
lexer.versions &= ~ HtmlVersion.Html40Strict;
}
else
{
lexer.versions &= ~ (HtmlVersion.Html40Strict | HtmlVersion.Html20);
}
if (checkstack && !node.Isimplicit)
{
checkstack = false;
if (lexer.InlineDup(node) > 0)
{
continue;
}
}
mode = Lexer.MixedContent;
}
else
{
checkstack = true;
mode = Lexer.IgnoreWhitespace;
}
if (node.Isimplicit)
{
Report.Warning(lexer, body, node, Report.INSERTING_TAG);
}
Node.InsertNodeAtEnd(body, node);
TidyNet.ParserImpl.parseTag(lexer, node, mode);
continue;
}
/* discard unexpected tags */
Report.Warning(lexer, body, node, Report.DISCARDING_UNEXPECTED);
}
}