commit 25feaa6fd74e0724e4cc1770c1d7ebfdceec1852 parent ebcc77c38ab6523b698e0915071872e3134b8932 Author: Matsuda Kenji <info@mtkn.jp> Date: Thu, 17 Oct 2024 18:04:36 +0900 support files with multiple h1 tags Diffstat:
M | bin/kagero | | | 2 | +- |
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/kagero b/bin/kagero @@ -44,7 +44,7 @@ list_files_to_replace(){ } render_html(){ - title=$(grep '<h1>' "$man/$1" | sed 's;^.*<h1>\(.*\)</h1>.*$;\1;' | sed 's;/;\\/;g') + title=$(grep '<h1 ' "$man/$1" | sed '1q' | sed 's;^.*<h1[^>]*>\(.*\)</h1>.*$;\1;' | sed 's;/;\\/;g') cat "$header" "$man/$1" "$footer" | sed '/\\$/{:a;N;/\\$/{$!ba;};s/\([^\]\)\\\n[ ]*/\1/g;}' | sed 's/\\\\$/\\/' |