當前位置: 首頁>>代碼示例>>C#>>正文


C# Lexer.PopInline方法代碼示例

本文整理匯總了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);
				}
			}
開發者ID:erikzaadi,項目名稱:atomsitethemes.erikzaadi.com,代碼行數:101,代碼來源:ParserImpl.cs


注:本文中的TidyNet.Lexer.PopInline方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。