Exemplo n.º 1
0
 function HtmlToMarkdown($Html, $FormatHtml = False)
 {
     if (!class_exists('HTML_Parser', False)) {
         define('HTML2MD_HEADER_STYLE', 'ATX');
         define('HTML2MD_SUPPRESS_ERRORS', True);
         define('HTML2MD_NEWLINE', "\n");
         require_once USEFULFUNCTIONS_VENDORS . '/html2markdown.php';
     }
     if ($FormatHtml) {
         $HtmlFormatter = Gdn::Factory('HtmlFormatter');
         if ($HtmlFormatter) {
             $Html = $HtmlFormatter->Format($Html);
         }
     }
     $HtmlParser = new HTML_Parser($Html);
     $Result = $HtmlParser->get_markdown();
     return $Result;
 }
Exemplo n.º 2
0
 function html2markdown($html)
 {
     $parser = new HTML_Parser($html);
     return $parser->get_markdown();
 }