예제 #1
0
        public override IMarkdownToken TryMatch(IMarkdownParser engine, IMarkdownParsingContext context)
        {
            var match = Blockquote.Match(context.CurrentMarkdown);

            if (match.Length == 0)
            {
                return(null);
            }
            var sourceInfo = context.Consume(match.Length);
            var capStr     = LeadingBlockquote.Replace(match.Value, string.Empty);
            var c          = engine.SwitchContext(MarkdownBlockContext.IsBlockQuote, true);
            var tokens     = engine.Tokenize(sourceInfo.Copy(capStr));

            engine.SwitchContext(c);
            return(new AzureBlockquoteBlockToken(this, engine.Context, tokens, sourceInfo));
        }
예제 #2
0
        public override IMarkdownToken TryMatch(IMarkdownParser engine, ref string source)
        {
            var match = Blockquote.Match(source);

            if (match.Length == 0)
            {
                return(null);
            }
            source = source.Substring(match.Length);
            var capStr = LeadingBlockquote.Replace(match.Value, string.Empty);
            var c      = engine.SwitchContext(MarkdownBlockContext.IsBlockQuote, true);
            var tokens = engine.Tokenize(capStr);

            engine.SwitchContext(c);
            return(new AzureBlockquoteBlockToken(this, engine.Context, tokens, match.Value));
        }