X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/58fa7679bccafd00f9a50bcd4a87e96876331b03..refs/pull/5685/head:/app/Entities/Tools/Markdown/HtmlToMarkdown.php diff --git a/app/Entities/Tools/Markdown/HtmlToMarkdown.php b/app/Entities/Tools/Markdown/HtmlToMarkdown.php index c56119fe1..473435c7f 100644 --- a/app/Entities/Tools/Markdown/HtmlToMarkdown.php +++ b/app/Entities/Tools/Markdown/HtmlToMarkdown.php @@ -1,14 +1,14 @@ -getConverterEnvironment()); $html = $this->prepareHtml($this->html); + return $converter->convert($html); } @@ -54,36 +55,38 @@ class HtmlToMarkdown protected function getConverterEnvironment(): Environment { $environment = new Environment([ - 'header_style' => 'atx', // 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. + 'header_style' => 'atx', // 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. 'strip_placeholder_links' => false, // Set to true to remove that doesn't have href. - '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