]> _ Git - cubist_util.git/commitdiff
#7954
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 21 Jan 2026 15:27:59 +0000 (16:27 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 21 Jan 2026 15:27:59 +0000 (16:27 +0100)
src/CommandLine/Docling.php

index 91af002f87eb70a7ca07ff6a7218d6660a3e0d0a..71bc1639df672db913c36be91597c0d68ded8575 100644 (file)
@@ -32,9 +32,14 @@ class Docling extends CommandLine
             $cli->setArg(null, $image);
             $cli->execute();
 
-            $md = file_get_contents($tmp . '/' . $f->getBasename('.' . $f->getExtension()) . '.md');
+            $mdOutput = $tmp . '/' . $f->getBasename('.' . $f->getExtension()) . '.md';
 
-            $html = Markdown::toHTML($md, false);
+            if (file_exists($mdOutput)) {
+                $md = file_get_contents($mdOutput);
+                $html = Markdown::toHTML($md, false);
+            } else {
+                $html = '';
+            }
             file_put_contents($out, $html);
         }
         if ($returnFile) {