/// <summary> /// Get a collection of lines from a HtmlNode /// </summary> public IList <HtmlLine> GetLines(HtmlNode node, ConvertOptions options) { HtmlLineCollection lineCollection = new HtmlLineCollection(); GetLines(node, lineCollection); IList <HtmlLine> lines = lineCollection.Lines; // remove consequitive empty lines HtmlLine previous = null; for (int i = lines.Count - 1; i >= 0; i--) { HtmlLine line = lines[i]; line.NormalisedValue = NormaliseText(line.Text); if (previous != null) { if (line.Text == null && previous.Text == null) { lines.RemoveAt(i + 1); } } previous = line; } return(lines); }
/// <summary> /// Get a collection of lines from html text /// </summary> public IList <HtmlLine> GetLines(string html, ConvertOptions options) { HtmlDocument doc = new HtmlDocument(); doc.LoadHtml(html); return(GetLines(doc.DocumentNode, options)); }
public override string GetFormattedText(ConvertOptions options) { if (string.IsNullOrEmpty(Text)) { return(null); } if (options.ImageBrackets) { return("[Image: " + Text + "]"); } else { return(Text); } }
public virtual string GetFormattedText(ConvertOptions options) { return(Text); }