diff --git a/.local/bin/exportmd b/.local/bin/exportmd index 5858ea8..ffbff7c 100755 --- a/.local/bin/exportmd +++ b/.local/bin/exportmd @@ -59,8 +59,10 @@ if test "$format" = epub -o "$format" = rtf -o "$format" = docx; then #if which pandoc >/dev/null; then # pandoc --reference-doc=$HOME/template.docx -s -o "$output" "$htmlfile" if which libreoffice >/dev/null; then - echo libreoffice --headless --writer --convert-to "$format" "$htmlfile" - libreoffice --headless --writer --convert-to "$format" "$htmlfile" + embed_dir="$(mktemp -d)" + libreoffice --headless --writer --convert-to "html:HTML (StarWriter):EmbedImages" --outdir "$embed_dir" "$htmlfile" + libreoffice --headless --writer --convert-to "$format" "$embed_dir"/* + rm -r "$embed_dir" else echo "No tengo libreoffice para convertir a $format." rm "$htmlfile"