Class HtmlToMarkdownConverter

java.lang.Object
org.sentrysoftware.maven.skin.HtmlToMarkdownConverter

public final class HtmlToMarkdownConverter extends Object
A simple HTML to Markdown converter using JSoup.

This converter handles common HTML elements and converts them to their Markdown equivalents. It is designed to work without external dependencies that might conflict with the Maven Site Plugin's classloader.

  • Method Details

    • convert

      public static String convert(String html)
      Converts HTML content to Markdown format.
      Parameters:
      html - HTML content to convert
      Returns:
      Markdown representation of the HTML
    • convert

      public static String convert(org.jsoup.nodes.Element element)
      Converts an HTML element to Markdown format.

      This method is more efficient than convert(String) when you already have a parsed JSoup Element, as it avoids re-parsing the HTML.

      Parameters:
      element - HTML element to convert
      Returns:
      Markdown representation of the HTML element