internal static ParagraphBlock Parse(string markdownText, int start, int end, out int actualEnd) { if (start > end) { actualEnd = start; return(null); } actualEnd = ParseBlocksHelper.FindLineEnd(markdownText, start, end); return(new ParagraphBlock { Inlines = Common.ParseInlines(markdownText, start, actualEnd), }); }
internal static ListElement Parse(string markdownText, int start, int end, out int actualEnd) { actualEnd = start; int contentStartPos = GetContentStartPos(markdownText, start, end, out ListStyle style); if (contentStartPos == start) { return(null); } actualEnd = ParseBlocksHelper.FindLineEnd(markdownText, contentStartPos, end); return(actualEnd > start ? new ListElement { Inlines = Common.ParseInlines(markdownText, contentStartPos, actualEnd), Style = style, } : null); }
internal static HeaderBlock Parse(string markdownText, int start, int end, out int actualEnd) { int headerLevel = GetHeaderLevel(markdownText, start, end, out int textStart); if (headerLevel == 0 || textStart > end || markdownText[textStart] == '\r' || markdownText[textStart] == '\n') { actualEnd = start; return(null); } actualEnd = ParseBlocksHelper.FindLineEnd(markdownText, textStart, end); return(new HeaderBlock { HeaderLevel = headerLevel, Inlines = Common.ParseInlines(markdownText, textStart, actualEnd), }); }