* @author Nick Cernis * * @link https://github.com/thephpleague/html-to-markdown/ Latest version on GitHub. * * @license http://www.opensource.org/licenses/mit-license.php MIT */ class HtmlConverter implements HtmlConverterInterface { /** * @var Environment */ protected $environment; /** * Constructor * * @param Environment|array $options Environment object or configuration options */ public function __construct($options = array()) { if ($options instanceof Environment) { $this->environment = $options; } elseif (is_array($options)) { $defaults = array( 'header_style' => 'setext', // Set to 'atx' to output H1 and H2 headers as # Header1 and ## Header2 'suppress_errors' => true, // Set to false to show warnings when loading malformed HTML 'strip_tags' => false, // Set to true to strip tags that don't have markdown equivalents. N.B. Strips tags, not their content. Useful to clean MS Word HTML output. 'bold_style' => '**', // DEPRECATED: Set to '__' if you prefer the underlined style 'italic_style' => '*', // DEPRECATED: Set to '_' if you prefer the underlined style 'remove_nodes' => '', // space-separated list of dom nodes that should be removed. example: 'meta style script' 'hard_break' => false, // Set to true to turn
into `\n` instead of ` \n` 'list_item_style' => '-', // Set the default character for each
  • in a