Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
1 files changed, 4 insertions, 2 deletions
-rw-r--r--awk-edits/Svg-height-attrib.awk6
diff --git a/awk-edits/Svg-height-attrib.awk b/awk-edits/Svg-height-attrib.awk
index fe3027a..e6dc07f 100644
--- a/awk-edits/Svg-height-attrib.awk
+++ b/awk-edits/Svg-height-attrib.awk
@@ -1,10 +1,12 @@
#
# == About
#
-# This script forces all images with SVG source to have a hard-coded height to them.
+# This script forces all images with SVG source, which aren't alone, to have
+# a hard-coded height to them. The idea is to not make SVGs inside text take
+# up the whole screen.
# This is mostly done for browsers that do not support CSS.
-/src="[^"]*\.svg"/ {
+/<p>.+<img src="[^"]*\.svg"/ || /src="[^"]*\.svg"[^>]*>.+<\/p>/ {
result = ""
while(match($0, /src="[^"]*\.svg"/)) {
result = result substr($0, 1, RSTART + RLENGTH - 1) " height=18";