главная|main page

состояние|status

блог|blog

файлы|files

программы|software

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Fenollosa <carlos.fenollosa@gmail.com>2016-10-24 12:02:22 +0200
committerCarlos Fenollosa <carlos.fenollosa@gmail.com>2016-10-24 12:02:22 +0200
commitc6a9bef8039e0800a801dce259ae1dc38c8fda50 (patch)
tree559a794cbcdefe8a0c58836e64f2dfa8c2a39b94
parent62226728172a6f1fa29ee3d5bd7364966fcc795d (diff)
Revert tag management from #116
-rwxr-xr-xbb.sh12
1 files 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 == "<p>$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 "<p>$template_tags_line_header " >> "$content"
- sed "s%</p>%%g
- s/^.*:[[:blank:]]*//
- s/[[:blank:]]\$//
- s/[[:blank:]]*,[[:blank:]]*/,/g
- s%\([^,]*\),%<a href='$prefix_tags\1.html'>\1</a>, %g
- s%, \([^,]*\)\$%, <a href='$prefix_tags\1.html'>\1</a></p>%
- " <<< "$line" >> "$content"
+ for item in "${array[@]}"; do
+ echo -n "<a href='$prefix_tags$item.html'>$item</a>, "
+ done | sed 's/, $/<\/p>/g' >> "$content"
else
echo "$line" >> "$content"
fi