public MarkdownImageInlineToken(IMarkdownRule rule, string href, string title, string text)
 {
     Rule = rule;
     Href = href;
     Title = title;
     Text = text;
 }
 public MarkdownEscapeInlineToken(IMarkdownRule rule, IMarkdownContext context, string content, string rawMarkdown)
 {
     Rule = rule;
     Context = context;
     Content = content;
     RawMarkdown = rawMarkdown;
 }
示例#3
0
 public DfmVideoBlockToken(IMarkdownRule rule, IMarkdownContext context, string link, SourceInfo sourceInfo)
 {
     Rule = rule;
     Context = context;
     Link = link;
     SourceInfo = sourceInfo;
 }
示例#4
0
 public AzureVideoBlockToken(IMarkdownRule rule, IMarkdownContext context, string videoId, SourceInfo sourceInfo)
 {
     Rule = rule;
     Context = context;
     VideoId = videoId;
     SourceInfo = sourceInfo;
 }
示例#5
0
 public MarkdownEngine(IMarkdownRule[] startRules, IMarkdownRule[] continueRules, IMarkdownRule[] endRules, IMarkdownRule[] endRules2)
 {
     _startRules = startRules;
     _continueRules = continueRules;
     _endRules = endRules;
     _endRules2 = endRules2;
 }
 public MarkdownTableBlockToken(IMarkdownRule rule, string[] header, Align[] align, string[][] cells)
 {
     Rule = rule;
     Header = header;
     Align = align;
     Cells = cells;
 }
示例#7
0
 public DfmSectionBlockToken(IMarkdownRule rule, IMarkdownContext context, string attributes, string rawMarkdown)
 {
     Rule = rule;
     Context = context;
     Attributes = attributes;
     RawMarkdown = rawMarkdown;
 }
示例#8
0
 public MarkdownTextToken(IMarkdownRule rule, IMarkdownContext context, string content, SourceInfo sourceInfo)
 {
     Rule = rule;
     Context = context;
     Content = content;
     SourceInfo = sourceInfo;
 }
示例#9
0
 public DfmSectionBlockToken(IMarkdownRule rule, IMarkdownContext context, string attributes, SourceInfo sourceInfo)
 {
     Rule = rule;
     Context = context;
     Attributes = attributes;
     SourceInfo = sourceInfo;
 }
示例#10
0
 public DfmYamlHeaderBlockToken(IMarkdownRule rule, IMarkdownContext context, string content, string rawMarkdown)
 {
     Rule = rule;
     Context = context;
     Content = content;
     RawMarkdown = rawMarkdown;
 }
示例#11
0
 public MarkdownCodeBlockToken(IMarkdownRule rule, IMarkdownContext context, string code, string rawMarkdown, string lang = null)
 {
     Rule = rule;
     Context = context;
     Code = code;
     Lang = lang;
     RawMarkdown = rawMarkdown;
 }
示例#12
0
 public GfmEmojiInlineToken(IMarkdownRule rule, IMarkdownContext context, string shortCode, string emoji, SourceInfo sourceInfo)
 {
     Rule = rule;
     Context = context;
     ShortCode = shortCode;
     Emoji = emoji;
     SourceInfo = sourceInfo;
 }
示例#13
0
 public AzureSelectorBlockToken(IMarkdownRule rule, IMarkdownContext context, string selectorType, string selectorConditions, SourceInfo sourceInfo)
 {
     Rule = rule;
     Context = context;
     SelectorType = selectorType;
     SelectorConditions = selectorConditions;
     SourceInfo = sourceInfo;
 }
示例#14
0
 public DfmNoteBlockToken(IMarkdownRule rule, IMarkdownContext context, string noteType, string content, string rawMarkdown)
 {
     Rule = rule;
     Context = context;
     Content = content;
     RawMarkdown = rawMarkdown;
     NoteType = noteType;
 }
示例#15
0
 public DfmNoteBlockToken(IMarkdownRule rule, IMarkdownContext context, string noteType, string content, SourceInfo sourceInfo)
 {
     Rule = rule;
     Context = context;
     Content = content;
     NoteType = noteType;
     SourceInfo = sourceInfo;
 }
示例#16
0
 public MarkdownLinkInlineToken(IMarkdownRule rule, string href, string title, string text, bool shouldApplyInlineRule = false)
 {
     Rule = rule;
     Href = href;
     Title = title;
     Text = text;
     ShouldApplyInlineRule = shouldApplyInlineRule;
 }
示例#17
0
 public MarkdownCodeBlockToken(IMarkdownRule rule, IMarkdownContext context, string code, string lang, SourceInfo sourceInfo)
 {
     Rule = rule;
     Context = context;
     Code = code;
     Lang = lang;
     SourceInfo = sourceInfo;
 }
示例#18
0
 public DfmFencesBlockToken(IMarkdownRule rule, string name, string path, string lang = null, string title = null)
 {
     Rule = rule;
     Path = path;
     Lang = lang;
     Name = name;
     Title = title;
 }
示例#19
0
 private static IMarkdownToken GroupTextTokens(IMarkdownParser parser, IMarkdownRule rule, bool wrapParagraph, StringBuffer textContent, SourceInfo si)
 {
     if (textContent.EndsWith('\n'))
     {
         textContent = textContent.Substring(0, textContent.GetLength() - 1);
     }
     var rawMarkdown = textContent.ToString();
     return CreateTwoPhaseToken(parser, rule, wrapParagraph, si.Copy(rawMarkdown));
 }
 public MarkdownImageInlineToken(IMarkdownRule rule, IMarkdownContext context, string href, string title, string text, string rawMarkdown)
 {
     Rule = rule;
     Context = context;
     Href = href;
     Title = title;
     Text = text;
     RawMarkdown = rawMarkdown;
 }
示例#21
0
 public DfmXrefInlineToken(IMarkdownRule rule, IMarkdownContext context, string href, string name, string title, string rawMarkdown)
 {
     Rule = rule;
     Context = context;
     Href = href;
     Name = name;
     Title = title;
     RawMarkdown = rawMarkdown;
 }
 protected AzureMigrationIncludeBasicToken(IMarkdownRule rule, IMarkdownContext context, string name, string src, string title, SourceInfo sourceInfo)
 {
     Rule = rule;
     Context = context;
     Name = name;
     Src = src;
     Title = title;
     SourceInfo = sourceInfo;
 }
示例#23
0
 public DfmXrefInlineToken(IMarkdownRule rule, IMarkdownContext context, string href, string name, string title, bool throwIfNotResolved, string rawMarkdown)
 {
     Rule = rule;
     Context = context;
     Href = href;
     Name = name;
     Title = title;
     ThrowIfNotResolved = throwIfNotResolved;
     RawMarkdown = rawMarkdown;
 }
示例#24
0
 public AzureIncludeInlineToken(IMarkdownRule rule, IMarkdownContext context, string src, string name, string title, string raw, string rawMarkdown)
 {
     Rule = rule;
     Context = context;
     Src = src;
     Name = name;
     Title = title;
     Raw = raw;
     RawMarkdown = rawMarkdown;
 }
示例#25
0
 public DfmIncludeInlineToken(IMarkdownRule rule, IMarkdownContext context, string src, string name, string title, string raw, SourceInfo sourceInfo)
 {
     Rule = rule;
     Context = context;
     Src = src;
     Name = name;
     Title = title;
     Raw = raw;
     SourceInfo = sourceInfo;
 }
示例#26
0
 public DfmFencesToken(IMarkdownRule rule, IMarkdownContext context, string name, string path, SourceInfo sourceInfo, string lang, string title, IDfmFencesBlockPathQueryOption pathQueryOption)
 {
     Rule = rule;
     Context = context;
     Path = path;
     Lang = lang;
     Name = name;
     Title = title;
     PathQueryOption = pathQueryOption;
     SourceInfo = sourceInfo;
 }
示例#27
0
 protected AzureIncludeBasicToken(IMarkdownRule rule, IMarkdownContext context, string src, string name, string title, ImmutableArray<IMarkdownToken> tokens, string raw, SourceInfo sourceInfo)
 {
     Rule = rule;
     Context = context;
     Src = src;
     Name = name;
     Title = title;
     Raw = raw;
     SourceInfo = sourceInfo;
     Tokens = tokens;
 }
示例#28
0
 public DfmFencesBlockToken(IMarkdownRule rule, IMarkdownContext context, string name, string path, string rawMarkdown, string lang = null, string title = null, DfmFencesBlockPathQueryOption pathQueryOption = null)
 {
     Rule = rule;
     Context = context;
     Path = path;
     Lang = lang;
     Name = name;
     Title = title;
     PathQueryOption = pathQueryOption;
     RawMarkdown = rawMarkdown;
 }
示例#29
0
 public MarkdownImageInlineToken(IMarkdownRule rule, IMarkdownContext context, string href, string title, string text, SourceInfo sourceInfo, MarkdownLinkType linkType, string refId)
 {
     Rule = rule;
     Context = context;
     Href = href;
     Title = title;
     Text = text;
     SourceInfo = sourceInfo;
     LinkType = linkType;
     RefId = refId;
 }
示例#30
0
 public TwoPhaseBlockToken(
     IMarkdownRule rule,
     IMarkdownContext context,
     string rawMarkdown,
     Func<IMarkdownParser, TwoPhaseBlockToken, IMarkdownToken> extractor)
 {
     Rule = rule;
     Context = context;
     RawMarkdown = rawMarkdown;
     _extractor = extractor;
 }
示例#31
0
 public MarkdownTagInlineToken(IMarkdownRule rule, IMarkdownContext context, SourceInfo sourceInfo)
 {
     Rule       = rule;
     Context    = context;
     SourceInfo = sourceInfo;
 }
示例#32
0
 public MarkdownNewLineBlockToken(IMarkdownRule rule, string content)
 {
     Rule    = rule;
     Content = content;
 }
示例#33
0
 public MarkdownIgnoreToken(IMarkdownRule rule, IMarkdownContext context, string rawMarkdown)
 {
     Rule        = rule;
     RawMarkdown = rawMarkdown;
 }
 public MarkdownHrBlockToken(IMarkdownRule rule, IMarkdownContext context, SourceInfo sourceInfo)
 {
     Rule       = rule;
     Context    = context;
     SourceInfo = sourceInfo;
 }
示例#35
0
 public AzureNoteBlockToken(IMarkdownRule rule, IMarkdownContext context, string noteType, string content, string rawMarkdown)
     : base(rule, context, content, rawMarkdown)
 {
     NoteType = noteType;
 }
 public static MarkdownParagraphBlockToken Create(IMarkdownRule rule, MarkdownParser engine, string content, SourceInfo sourceInfo)
 {
     return(new MarkdownParagraphBlockToken(rule, engine.Context, engine.TokenizeInline(sourceInfo.Copy(content)), sourceInfo));
 }
示例#37
0
 public MarkdownListItemBlockToken(IMarkdownRule rule, ImmutableArray <IMarkdownToken> tokens, bool loose)
 {
     Rule   = rule;
     Tokens = tokens;
     Loose  = loose;
 }
 public MarkdownHrBlockToken(IMarkdownRule rule)
 {
     Rule = rule;
 }
示例#39
0
 public MarkdownIgnoreToken(IMarkdownRule rule)
 {
     Rule = rule;
 }
 public DfmSectionBeginBlockToken(IMarkdownRule rule, string attributes)
 {
     Rule       = rule;
     Attributes = attributes;
 }
示例#41
0
 public MarkdownParagraphBlockToken(IMarkdownRule rule, string content)
 {
     Rule    = rule;
     Content = content;
 }
示例#42
0
 public GfmDelInlineToken(IMarkdownRule rule, string content)
 {
     Rule    = rule;
     Content = content;
 }
示例#43
0
 public AzureIncludeInlineToken(IMarkdownRule rule, IMarkdownContext context, string src, string name, string title, ImmutableArray <IMarkdownToken> tokens, string raw, SourceInfo sourceInfo)
     : base(rule, context, src, name, title, tokens, raw, sourceInfo)
 {
 }
 public static MarkdownParagraphBlockToken Create(IMarkdownRule rule, MarkdownParser engine, string content, string rawMarkdown)
 {
     return(new MarkdownParagraphBlockToken(rule, engine.Context, engine.TokenizeInline(content), rawMarkdown));
 }
示例#45
0
 public MarkdownTextToken(IMarkdownRule rule, string content)
 {
     Rule    = rule;
     Content = content;
 }
示例#46
0
        protected StringBuffer RenderTokens(IMarkdownRenderer engine, ImmutableArray <IMarkdownToken> tokens, MarkdownBlockContext context, bool wrapParagraph = false, IMarkdownRule rule = null)
        {
            var content     = StringBuffer.Empty;
            var textContent = StringBuffer.Empty;

            foreach (var t in tokens)
            {
                var text = t as MarkdownTextToken;
                if (text != null)
                {
                    if (textContent != StringBuffer.Empty)
                    {
                        textContent += "\n";
                    }
                    textContent += text.Content;
                    continue;
                }
                if (!wrapParagraph && t is MarkdownNewLineBlockToken)
                {
                    continue;
                }
                if (textContent != StringBuffer.Empty)
                {
                    content    += RenderTextInTokens(engine, context, wrapParagraph, rule, textContent, t.RawMarkdown);
                    textContent = StringBuffer.Empty;
                }
                content += engine.Render(t);
            }
            if (textContent != StringBuffer.Empty)
            {
                content += RenderTextInTokens(engine, context, wrapParagraph, rule, textContent, textContent);
            }
            return(content);
        }
示例#47
0
 private StringBuffer RenderTextInTokens(IMarkdownRenderer renderer, MarkdownBlockContext context, bool wrapParagraph, IMarkdownRule rule, StringBuffer textContent, string rawMarkdown)
 {
     if (wrapParagraph)
     {
         var parser        = renderer.Engine.Parser;
         var c             = parser.SwitchContext(context);
         var inlineContent = parser.TokenizeInline(textContent);
         parser.SwitchContext(c);
         return(Render(renderer, new MarkdownParagraphBlockToken(rule, context, inlineContent, rawMarkdown), context));
     }
     else
     {
         return(ApplyInline(renderer, textContent, context));
     }
 }
 public AzureBlockquoteBlockToken(IMarkdownRule rule, IMarkdownContext context, ImmutableArray <IMarkdownToken> tokens, string rawMarkdown)
     : base(rule, context, tokens, rawMarkdown)
 {
 }
示例#49
0
 private StringBuffer RenderTextInTokens(IMarkdownRenderer engine, MarkdownBlockContext context, bool wrapParagraph, IMarkdownRule rule, StringBuffer textContent, string rawMarkdown)
 {
     if (wrapParagraph)
     {
         return(Render(engine, new MarkdownParagraphBlockToken(rule, context, engine.Engine.Parser.TokenizeInline(textContent), rawMarkdown), context));
     }
     else
     {
         return(ApplyInline(engine, textContent, context));
     }
 }
示例#50
0
 public DfmFencesToken(IMarkdownRule rule, IMarkdownContext context, string name, string path, SourceInfo sourceInfo, string lang, string title, IDfmFencesBlockPathQueryOption pathQueryOption)
     : this(rule, context, name, path, sourceInfo, lang, title, pathQueryOption, null)
 {
 }
示例#51
0
 public MarkdownBlockquoteBlockToken(IMarkdownRule rule, ImmutableArray <IMarkdownToken> tokens)
 {
     Rule   = rule;
     Tokens = tokens;
 }
示例#52
0
 public MarkdownListBlockToken(IMarkdownRule rule, ImmutableArray <IMarkdownToken> tokens, bool ordered)
 {
     Rule    = rule;
     Tokens  = tokens;
     Ordered = ordered;
 }
 public MarkdownCodeInlineToken(IMarkdownRule rule, string content)
 {
     Rule    = rule;
     Content = content;
 }
示例#54
0
        private static TwoPhaseBlockToken CreateTwoPhaseToken(IMarkdownParser parser, IMarkdownRule rule, bool wrapParagraph, SourceInfo sourceInfo)
        {
            var inlineContent = parser.TokenizeInline(sourceInfo);

            if (wrapParagraph)
            {
                return(new TwoPhaseBlockToken(
                           rule,
                           parser.Context,
                           sourceInfo,
                           (p, t) => new MarkdownParagraphBlockToken(t.Rule, p.Context, p.TokenizeInline(t.SourceInfo), t.SourceInfo)));
            }
            else
            {
                return(new TwoPhaseBlockToken(
                           rule,
                           parser.Context,
                           sourceInfo,
                           (p, t) => new MarkdownNonParagraphBlockToken(t.Rule, p.Context, p.TokenizeInline(t.SourceInfo), t.SourceInfo)));
            }
        }
示例#55
0
 public MarkdownNewLineBlockToken(IMarkdownRule rule, IMarkdownContext context, string rawMarkdown)
 {
     Rule        = rule;
     Context     = context;
     RawMarkdown = rawMarkdown;
 }
示例#56
0
 public MarkdownTagInlineToken(IMarkdownRule rule, IMarkdownContext context, string rawMarkdown)
 {
     Rule        = rule;
     Context     = context;
     RawMarkdown = rawMarkdown;
 }
示例#57
0
 public AzureIncludeInlineToken(IMarkdownRule rule, IMarkdownContext context, string src, string name, string title, string raw, string rawMarkdown)
     : base(rule, context, src, name, title, raw, rawMarkdown)
 {
 }
示例#58
0
 public DfmFencesInlineToken(IMarkdownRule rule, IMarkdownContext context, string name, string path, SourceInfo sourceInfo, string lang = null, string title = null, IDfmFencesBlockPathQueryOption pathQueryOption = null)
     : base(rule, context, name, path, sourceInfo, lang, title, pathQueryOption)
 {
 }
示例#59
0
 public AzureBlockquoteBlockToken(IMarkdownRule rule, IMarkdownContext context, ImmutableArray <IMarkdownToken> tokens, SourceInfo sourceInfo)
     : base(rule, context, tokens, sourceInfo)
 {
 }
示例#60
0
 public DfmFencesInlineToken(IMarkdownRule rule, IMarkdownContext context, string name, string path, SourceInfo sourceInfo, string lang = null, string title = null, string queryStringAndFragment = null)
     : base(rule, context, name, path, sourceInfo, lang, title, queryStringAndFragment)
 {
 }