Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
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;
+}