本文整理汇总了C#中TidyNet.Lexer.PushInline方法的典型用法代码示例。如果您正苦于以下问题:C# Lexer.PushInline方法的具体用法?C# Lexer.PushInline怎么用?C# Lexer.PushInline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TidyNet.Lexer
的用法示例。
在下文中一共展示了Lexer.PushInline方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Parse
public virtual void Parse(Lexer lexer, Node element, short mode)
{
Node node, parent;
TagTable tt = lexer.Options.tt;
if ((element.Tag.Model & ContentModel.Empty) != 0)
{
return;
}
if (element.Tag == tt.TagA)
{
if (element.Attributes == null)
{
Report.Warning(lexer, element.Parent, element, Report.DISCARDING_UNEXPECTED);
Node.DiscardElement(element);
return;
}
}
/*
ParseInline is used for some block level elements like H1 to H6
For such elements we need to insert inline emphasis tags currently
on the inline stack. For Inline elements, we normally push them
onto the inline stack provided they aren't implicit or OBJECT/APPLET.
This test is carried out in PushInline and PopInline, see istack.c
We don't push A or SPAN to replicate current browser behavior
*/
if (((element.Tag.Model & ContentModel.Block) != 0) || (element.Tag == tt.TagDt))
{
lexer.InlineDup(null);
}
else if ((element.Tag.Model & ContentModel.Inline) != 0 && element.Tag != tt.TagA && element.Tag != tt.TagSpan)
{
lexer.PushInline(element);
}
if (element.Tag == tt.TagNobr)
{
lexer.badLayout |= Report.USING_NOBR;
}
else if (element.Tag == tt.TagFont)
{
lexer.badLayout |= Report.USING_FONT;
}
/* Inline elements may or may not be within a preformatted element */
if (mode != Lexer.Preformatted)
{
mode = Lexer.MixedContent;
}
while (true)
{
node = lexer.GetToken(mode);
if (node == null)
{
break;
}
/* end tag for current element */
if (node.Tag == element.Tag && node.Type == Node.EndTag)
{
if ((element.Tag.Model & ContentModel.Inline) != 0 && element.Tag != tt.TagA)
{
lexer.PopInline(node);
}
if (!((mode & Lexer.Preformatted) != 0))
{
Node.TrimSpaces(lexer, element);
}
/*
if a font element wraps an anchor and nothing else
then move the font element inside the anchor since
otherwise it won't alter the anchor text color
*/
if (element.Tag == tt.TagFont && element.Content != null && element.Content == element.Last)
{
Node child = element.Content;
if (child.Tag == tt.TagA)
{
child.Parent = element.Parent;
child.Next = element.Next;
child.Prev = element.Prev;
if (child.Prev != null)
{
child.Prev.Next = child;
}
else
{
child.Parent.Content = child;
}
if (child.Next != null)
{
child.Next.Prev = child;
}
else
//.........这里部分代码省略.........