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);
            }
        }
Exemplo n.º 2
0
            public static ParseResult ParseFrom(
                ParseInput lines,
                bool innerParagraph
                )
            {
                ParseResult result = new ParseResult();
                ParseResult innerResult;
                IHtmlable   returnedElement;

                // If the list items content contains another list
                if (MarkdownList.CanParseFrom(lines))
                {
                    innerResult     = MarkdownList.ParseFrom(lines);
                    returnedElement = new MarkdownListItem(
                        innerResult.GetContent()
                        );
                }
                else
                {
                    // Otherwise, if the item content should go in a paragraph
                    if (innerParagraph)
                    {
                        innerResult     = MarkdownParagraph.ParseFrom(lines);
                        returnedElement = new MarkdownListItem(
                            innerResult.GetContent()
                            );
                    }
                    else
                    {
                        // line item content should not go in a paragraph
                        returnedElement = new MarkdownListItem(
                            MarkdownParser.ParseInnerText(lines)
                            );
                    }
                }
                result.Success = true;
                result.AddContent(
                    returnedElement
                    );
                return(result);
            }