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; }
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; }
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); } }
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); }
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)); } }