главная|main page

состояние|status

блог|blog

файлы|files

программы|software

summaryrefslogtreecommitdiff
path: root/bb.sh
diff options
context:
space:
mode:
authorCarlos Fenollosa <carlos.fenollosa@gmail.com>2014-02-13 08:26:05 +0100
committerCarlos Fenollosa <carlos.fenollosa@gmail.com>2014-02-13 08:26:05 +0100
commiteeb8c057d932a3a1b03c7abd7dba23d1e69f7f9c (patch)
tree351d3442d6ff86119770bd3a4edc3ad249cb4e59 /bb.sh
parent72b32a918f2f0fcd028fd0a48832b6f65d713e0f (diff)
parentb2b87e584c9815e194d46bb28d60d80dd4eeee06 (diff)
Merge pull request #23 from pointychimp/master
Fix for <> in title when using markdown
Diffstat (limited to 'bb.sh')
-rwxr-xr-xbb.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/bb.sh b/bb.sh
index 665622f..c165e9e 100755
--- a/bb.sh
+++ b/bb.sh
@@ -360,7 +360,7 @@ create_html_page() {
echo '<!-- entry begin -->' >> "$filename" # marks the beginning of the whole post
echo '<h3><a class="ablack" href="'$global_url/$file_url'">' >> "$filename"
# remove possible <p>'s on the title because of markdown conversion
- echo "$(echo "$title" | sed 's/\<\/*p\>//g')" >> "$filename"
+ echo "$(echo "$title" | sed 's/<\/*p>//g')" >> "$filename"
echo '</a></h3>' >> "$filename"
if [[ "$timestamp" == "" ]]; then
echo '<div class="subtitle">'$(LC_ALL=$date_locale date +"$date_format")' &mdash; ' >> "$filename"
@@ -399,9 +399,10 @@ parse_file() {
title=""
while read line; do
if [[ "$title" == "" ]]; then
- title="$line"
+ # set title and
# remove extra <p> and </p> added by markdown
- filename="$(echo $title | sed 's/\<\/*p\>//g' | tr [:upper:] [:lower:])"
+ title=$(echo "$line" | sed 's/<\/*p>//g')
+ filename="$(echo $title | tr [:upper:] [:lower:])"
filename="$(echo $filename | sed 's/\ /-/g')"
filename="$(echo $filename | tr -dc '[:alnum:]-')" # html likes alphanumeric
filename="$filename.html"