From be1a57a5e1f84fe3d738207dbae220666a352089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Wed, 5 Jan 2022 16:55:59 +0100 Subject: bin/func: Serialize h1 html id for w3c validator --- bin/func | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -

+

${_title}

EOF -- cgit v1.2.3