コード例 #1
0
 public FromMarkupTagToHtml(string markupRuleHtmlTag, bool isClosingHtmlTag, int lenghtOfReplacedMarkupTag, IMarkupRule rule)
 {
     TagName                   = markupRuleHtmlTag;
     IsClosingHtmlTag          = isClosingHtmlTag;
     LenghtOfReplacedMarkupTag = lenghtOfReplacedMarkupTag;
     Rule = rule;
 }
コード例 #2
0
        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);
        }
コード例 #3
0
 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);
 }
コード例 #4
0
 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);
 }
コード例 #5
0
 public ParsedSubline(int leftBorderOfSubline, int rightBorderOfSubline, IMarkupRule rule)
 {
     LeftBorderOfSubline  = leftBorderOfSubline;
     RightBorderOfSubline = rightBorderOfSubline;
     MarkupRule           = rule;
 }
コード例 #6
0
 public QuotationParser()
 {
     quotationRule = new Quotation();
 }
コード例 #7
0
 public MultilineCodeTagsParser()
 {
     rule = new MultilineCode();
 }
コード例 #8
0
ファイル: Token.cs プロジェクト: Denchick/markdown2html
 public Token(int leftBorderOfSubline, int rightBorderOfSubline, IMarkupRule rule)
 {
     LeftBorderOfSubline  = leftBorderOfSubline;
     RightBorderOfSubline = rightBorderOfSubline;
     MarkupRule           = rule;
 }