# HG changeset patch # User Pascal Bellard # Date 1645893435 0 # Node ID 4495814243a29240a9675bfa0db03c00fa1caac0 # Parent 035e82f04c94a2943868e4825326a6fca605454d sokojs: add shrink.sh (again) diff -r 035e82f04c94 -r 4495814243a2 sokojs/stuff/shrink.sh --- a/sokojs/stuff/shrink.sh Sat Feb 26 15:02:05 2022 +0000 +++ b/sokojs/stuff/shrink.sh Sat Feb 26 16:37:15 2022 +0000 @@ -37,11 +37,12 @@ } else if (/^Row/) print "Row=" row " //!" $0 else if (/^Col/) print "Col=" col-begin-end+length(tab) " //!" $0 - else if (/[0-9]\\">",$/) { + else if (/\\"[0-9]*\\">",$/ && n != 0) { s=$0; sub(/.*value=\\"/,"",s); sub(/\\">.*/,"",s) l=length(line[0])-3; n-=cut+row; begin-=length(tab) n=s - (l*n) - begin - ((begin+end)*(int(s/l)-n)) print "document.write(\"\", //!" $0 + n=0 } else print }' < $file > $file.$$ mv -f $file.$$ $file