public override HtmlNode ToHtmlNode() { var matches = HeadRegex.Match(line).Groups; int rank = matches[1].Length; HtmlNode node = new HtmlNode($"h{rank}"); foreach (HtmlObject o in GetHtmlObjects(matches[3].Value, GetTextTokens(matches[3].Value, 0))) { node.AddElement(o); } return(node); }
public MdParaElement(string[] lines, ref int index) { for (; index < lines.Length; index++) { string line = lines[index]; if (!string.IsNullOrWhiteSpace(line) && !HeadRegex.IsMatch(line) && !ListItemRegex.IsMatch(line) && !CodeBlockRegex.IsMatch(line)) { this.lines.Add(line); } else { index--; break; } } }