aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bin/func7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/func b/bin/func
index 62d65a0..f637749 100644
--- a/bin/func
+++ b/bin/func
@@ -22,6 +22,10 @@ date_default_timezone="+0200"
uname=$(uname)
+__to_html_id() {
+ cat /dev/stdin | sed 's/ /%20/g'
+}
+
__get_value() {
# 1: filename
# 2: Attribute name
@@ -202,9 +206,10 @@ __generate_metadata() {
if [ "${_show_title}" = "" ]; then
_title=$(__get_value_title "${1}")
+ _title_id=$(echo ${_title} | __to_html_id)
cat <<-EOF
- <h1 id=\"${_title}\">
+ <h1 id="${_title_id}">
${_title}
</h1>
EOF
remember that computers suck.