2 using System.Collections.Generic;
12 : this (name, termType, tag, string.Empty, htmlElementName) { }
15 : base (name, termType, openTag, closeTag, htmlElementName) { }
18 bool isHeadingOrList = TermType == WikiTermType.Heading || TermType == WikiTermType.List;
20 bool isAfterNewLine = (context.PreviousToken == null || context.PreviousToken.Terminal == Grammar.NewLine);
21 if(!isAfterNewLine)
return null;
24 source.PreviewPosition += OpenTag.Length;
27 const string whitespaces =
" \t\r\n\v";
28 if (!whitespaces.Contains(source.
PreviewChar))
return null;
30 var token = source.CreateToken(this.OutputTerminal);
WikiTagTerminal(string name, WikiTermType termType, string openTag, string closeTag, string htmlElementName)
char PreviewChar
Gets a char at preview position
Interface for Terminals to access the source stream and produce tokens.
WikiTagTerminal(string name, WikiTermType termType, string tag, string htmlElementName)
override Token TryMatch(ParsingContext context, ISourceStream source)
Tokens are produced by scanner and fed to parser, optionally passing through Token filters in between...
bool MatchSymbol(string symbol, bool ignoreCase)
Tries to match the symbol with the text at current preview position.