2 using System.Collections.Generic;
23 BlockType = blockType;
27 if (!source.
MatchSymbol(OpenTag,
true))
return null;
28 source.PreviewPosition += OpenTag.Length;
29 var endPos = source.Text.IndexOf(CloseTag, source.PreviewPosition);
32 content = source.Text.Substring(source.PreviewPosition, endPos - source.PreviewPosition);
33 source.PreviewPosition = endPos + CloseTag.Length;
35 content = source.Text.Substring(source.PreviewPosition, source.Text.Length - source.PreviewPosition);
36 source.PreviewPosition = source.Text.Length;
38 var token = source.CreateToken(this.OutputTerminal, content);
override Token TryMatch(ParsingContext context, ISourceStream source)
WikiBlockTerminal(string name, WikiBlockType blockType, string openTag, string closeTag, string htmlElementName)
Interface for Terminals to access the source stream and produce tokens.
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.
readonly WikiBlockType BlockType