32 function dolMd2Html($content, $parser =
'parsedown', $replaceimagepath =
null)
34 if (is_array($replaceimagepath)) {
35 foreach ($replaceimagepath as $key => $val) {
36 $keytoreplace =
']('.$key;
37 $valafter =
']('.$val;
38 $content = preg_replace(
'/'.preg_quote($keytoreplace,
'/').
'/m', $valafter, $content);
41 if ($parser ==
'parsedown') {
42 include_once DOL_DOCUMENT_ROOT.
'/includes/parsedown/Parsedown.php';
43 $Parsedown =
new Parsedown();
44 $content = $Parsedown->text($content);
46 $content = nl2br($content);
61 function dolMd2Asciidoc($content, $parser =
'dolibarr', $replaceimagepath =
null)
63 if (is_array($replaceimagepath)) {
64 foreach ($replaceimagepath as $key => $val) {
65 $keytoreplace =
']('.$key;
66 $valafter =
']('.$val;
67 $content = preg_replace(
'/'.preg_quote($keytoreplace,
'/').
'/m', $valafter, $content);
72 $content = preg_replace(
'/<!--.*-->/msU',
'', $content);
dolMd2Asciidoc($content, $parser='dolibarr', $replaceimagepath=null)
Function to parse MD content into ASCIIDOC.
dolMd2Html($content, $parser='parsedown', $replaceimagepath=null)
Function to parse MD content into HTML.