Skip to content

Commit c6a9bef

Browse files
committed
Revert tag management from cfenollosa#116
1 parent 6222672 commit c6a9bef

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

bb.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -536,14 +536,12 @@ parse_file() {
536536
content=$filename.tmp
537537
# Parse possible tags
538538
elif [[ $line == "<p>$template_tags_line_header"* ]]; then
539+
tags=$(echo "$line" | cut -d ":" -f 2- | sed -e 's/<\/p>//g' -e 's/^ *//' -e 's/ *$//' -e 's/, /,/g')
540+
IFS=, read -r -a array <<< "$tags"
539541
echo -n "<p>$template_tags_line_header " >> "$content"
540-
sed "s%</p>%%g
541-
s/^.*:[[:blank:]]*//
542-
s/[[:blank:]]\$//
543-
s/[[:blank:]]*,[[:blank:]]*/,/g
544-
s%\([^,]*\),%<a href='$prefix_tags\1.html'>\1</a>, %g
545-
s%, \([^,]*\)\$%, <a href='$prefix_tags\1.html'>\1</a></p>%
546-
" <<< "$line" >> "$content"
542+
for item in "${array[@]}"; do
543+
echo -n "<a href='$prefix_tags$item.html'>$item</a>, "
544+
done | sed 's/, $/<\/p>/g' >> "$content"
547545
else
548546
echo "$line" >> "$content"
549547
fi

0 commit comments

Comments
 (0)