public FromMarkupTagToHtml(string markupRuleHtmlTag, bool isClosingHtmlTag, int lenghtOfReplacedMarkupTag, IMarkupRule rule) { TagName = markupRuleHtmlTag; IsClosingHtmlTag = isClosingHtmlTag; LenghtOfReplacedMarkupTag = lenghtOfReplacedMarkupTag; Rule = rule; }
public void CorrectConvertingImage(string text, string link, string alt, string otherText = "") { var imgTag = new IMarkupRule[] { new ImageTag(), }; var render = new DefaultHtmlConverter(imgTag, new IParser[] { new ImageTagParser(imgTag) }); var html = $"{otherText}<img src=\"{link}\" alt=\"{alt}\">\r\n"; var result = render.GetTextInHtml(text); result.Should().BeEquivalentTo(html); }
private static ParsedSubline GetClosingElement(Stack <ParsedSubline> stack, IMarkupRule rule) { while (stack.Count > 0) { var element = stack.Pop(); if (element.MarkupRule == rule) { return(element); } } return(null); }
private static Token GetClosingElement(Stack <Token> stack, IMarkupRule rule) { while (stack.Count > 0) { var element = stack.Pop(); if (element.MarkupRule == rule) { return(element); } } return(null); }
public ParsedSubline(int leftBorderOfSubline, int rightBorderOfSubline, IMarkupRule rule) { LeftBorderOfSubline = leftBorderOfSubline; RightBorderOfSubline = rightBorderOfSubline; MarkupRule = rule; }
public QuotationParser() { quotationRule = new Quotation(); }
public MultilineCodeTagsParser() { rule = new MultilineCode(); }
public Token(int leftBorderOfSubline, int rightBorderOfSubline, IMarkupRule rule) { LeftBorderOfSubline = leftBorderOfSubline; RightBorderOfSubline = rightBorderOfSubline; MarkupRule = rule; }