From c6a9bef8039e0800a801dce259ae1dc38c8fda50 Mon Sep 17 00:00:00 2001 From: Carlos Fenollosa Date: Mon, 24 Oct 2016 12:02:22 +0200 Subject: [PATCH] Revert tag management from #116 --- bb.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/bb.sh b/bb.sh index 21eeaca..b75a449 100755 --- a/bb.sh +++ b/bb.sh @@ -536,14 +536,12 @@ parse_file() { content=$filename.tmp # Parse possible tags elif [[ $line == "

$template_tags_line_header"* ]]; then + tags=$(echo "$line" | cut -d ":" -f 2- | sed -e 's/<\/p>//g' -e 's/^ *//' -e 's/ *$//' -e 's/, /,/g') + IFS=, read -r -a array <<< "$tags" echo -n "

$template_tags_line_header " >> "$content" - sed "s%

%%g - s/^.*:[[:blank:]]*// - s/[[:blank:]]\$// - s/[[:blank:]]*,[[:blank:]]*/,/g - s%\([^,]*\),%\1, %g - s%, \([^,]*\)\$%, \1

% - " <<< "$line" >> "$content" + for item in "${array[@]}"; do + echo -n "$item, " + done | sed 's/, $/<\/p>/g' >> "$content" else echo "$line" >> "$content" fi