Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit3505683bcc224af99cf6b2b568ce054f17d944d4 (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-09-10 12:17:59 +0300
Committer
 Syndamia <kamen@syndamia.com>
2023-09-10 12:17:59 +0300
Files564c5ed72210eb352677047399bf35916aa4ef12
syndamia.com-3505683bcc224af99cf6b2b568ce054f17d944d4.tar
syndamia.com-3505683bcc224af99cf6b2b568ce054f17d944d4.tar.gz
syndamia.com-3505683bcc224af99cf6b2b568ce054f17d944d4.zip
Parent774b75ba52daa7277006d0f3e75e8dca26cf7f13 (diff)
[awk-edits] Added a script which adds height attribute to SVG images
1 files changed, 14 insertions, 0 deletions
-rw-r--r--awk-edits/Svg-height-attrib.awk14
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;
+}