From 3505683bcc224af99cf6b2b568ce054f17d944d4 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 10 Sep 2023 12:17:59 +0300 Subject: [awk-edits] Added a script which adds height attribute to SVG images --- awk-edits/Svg-height-attrib.awk | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 awk-edits/Svg-height-attrib.awk diff --git a/awk-edits/Svg-height-attrib.awk b/awk-edits/Svg-height-attrib.awk new file mode 100644 index 0000000..d409159 --- /dev/null +++ b/awk-edits/Svg-height-attrib.awk @@ -0,0 +1,14 @@ +# +# == About +# +# This script forces all images with SVG source to have a hard-coded height to them. +# This is mostly done for browsers that do not support CSS. + +/src="[^"]*\.svg"/ { + result = "" + while(match($0, @/src="[^"]*\.svg"/)) { + result = result substr($0, 1, RSTART + RLENGTH - 1) " height=18"; + $0 = substr($0, RSTART + RLENGTH); + } + $0 = result $0; +} -- cgit v1.3.1-26-gb76a