From 934b88bcf02f592dc4a21b1d9dd5584b604b6848 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Fri, 2 Feb 2024 09:03:02 +0100 Subject: [PATCH] generator md: Capture output of markdown --- qsgen2 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/qsgen2 b/qsgen2 index 0a3298d..7ae18d3 100755 --- a/qsgen2 +++ b/qsgen2 @@ -153,12 +153,14 @@ elif [[ ${generator} == "markdown" ]]; then else # Usage: ${engine} ${1} - Where 1 is the file you want parsed function engine() { + typeset -g "$1"="$2" + local command="/usr/bin/markdown" local c-opts="-d -n -s" - - local buffer=$(< <($(command) $c-opts "$1")) - - echo "${buffer}" + + eval "$1=\$(< <($(command) $c-opts \"${(P)1}\"))" + + # echo "${(P)1}" } export file_ext=md fi