Ejemplo n.º 1
0
 public MarkdownLinkInlineToken(IMarkdownRule rule, IMarkdownContext context, string href, string title, ImmutableArray <IMarkdownToken> content, SourceInfo sourceInfo, MarkdownLinkType linkType, string refId)
 {
     Rule       = rule;
     Context    = context;
     Href       = href;
     Title      = title;
     Content    = content;
     SourceInfo = sourceInfo;
     LinkType   = linkType;
     RefId      = refId;
 }
Ejemplo n.º 2
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;
 }
 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;
 }
Ejemplo n.º 4
0
 protected virtual IMarkdownToken GenerateToken(IMarkdownParser parser, string href, string title, string text, bool isImage, SourceInfo sourceInfo, MarkdownLinkType linkType, string refId)
 {
     var escapedHref = Regexes.Helper.MarkdownEscape.Replace(href, m => m.Groups[1].Value);
     if (isImage)
     {
         return new MarkdownImageInlineToken(this, parser.Context, escapedHref, title, text, sourceInfo, linkType, refId);
     }
     else
     {
         return new MarkdownLinkInlineToken(this, parser.Context, escapedHref, title, parser.Tokenize(sourceInfo.Copy(text)), sourceInfo, linkType, refId);
     }
 }
Ejemplo n.º 5
0
        protected virtual IMarkdownToken GenerateToken(IMarkdownParser parser, string href, string title, string text, bool isImage, SourceInfo sourceInfo, MarkdownLinkType linkType, string refId)
        {
            var            escapedHref = StringHelper.UnescapeMarkdown(href);
            var            c           = parser.SwitchContext(MarkdownInlineContext.IsInLink, BoxedTrue);
            IMarkdownToken result;

            if (isImage)
            {
                result = new MarkdownImageInlineToken(this, parser.Context, escapedHref, title, text, sourceInfo, linkType, refId);
            }
            else
            {
                result = new MarkdownLinkInlineToken(this, parser.Context, escapedHref, title, parser.Tokenize(sourceInfo.Copy(text)), sourceInfo, linkType, refId);
            }
            parser.SwitchContext(c);
            return(result);
        }
Ejemplo n.º 6
0
        protected virtual IMarkdownToken GenerateToken(IMarkdownParser parser, string href, string title, string text, bool isImage, SourceInfo sourceInfo, MarkdownLinkType linkType, string refId)
        {
            var escapedHref = Regexes.Helper.MarkdownEscape.Replace(href, m => m.Groups[1].Value);

            if (isImage)
            {
                return(new MarkdownImageInlineToken(this, parser.Context, escapedHref, title, text, sourceInfo, linkType, refId));
            }
            else
            {
                return(new MarkdownLinkInlineToken(this, parser.Context, escapedHref, title, parser.Tokenize(sourceInfo.Copy(text)), sourceInfo, linkType, refId));
            }
        }