private void ParseLineGroup(
            ParseInput input
            )
        {
            ParseResult result;

            if (MarkdownHeading.CanParseFrom(input))
            {
                result = MarkdownHeading.ParseFrom(input);
            }
            else if (MarkdownHorizontalRule.CanParseFrom(input))
            {
                result = MarkdownHorizontalRule.ParseFrom(input);
            }
            else if (MarkdownQuote.CanParseFrom(input))
            {
                result = MarkdownQuote.ParseFrom(input);
            }
            else if (MarkdownList.CanParseFrom(input))
            {
                result = MarkdownList.ParseFrom(input);
            }
            else
            {
                result = MarkdownParagraph.ParseFrom(input);
            }
            foreach (IHtmlable entry in result.GetContent())
            {
                Content.AddLast(entry);
            }
        }
示例#2
0
        private static ParseResult ParseDoubleLineHeading(
            ParseInput input
            )
        {
            ArraySegment <string> lines  = input.Lines();
            ParseResult           result = new ParseResult();
            int level;

            if (lines[1].StartsWith("="))
            {
                level = 1;
            }
            else
            {
                level = 2;
            }
            MarkdownHeading element = new MarkdownHeading(
                level,
                MarkdownParser.ParseInnerText(
                    new ParseInput(
                        input,
                        lines[0]
                        )
                    )
                );

            lines[0]       = "";
            lines[1]       = "";
            result.Success = true;
            result.AddContent(
                element
                );
            return(result);
        }