You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#tspan to text
sed -ri -e ':a' -e 'N' -e '$!ba' -e "s/<text([-[:alnum:]\,\.\"\=\:\ \#\(\)]*)( x=\"[-[:digit:]\.\ ]+\" y=\"[-[:digit:]\.\ ]+\")/<text\2\1/g"$i# that x ist at the beginning (otherwise the next line would not work)
sed -ri -e ':a' -e 'N' -e '$!ba' -e "s/<text( x=\"[-[:digit:]\.\ ]+\" y=\"[-[:digit:]\.\ ]+\"|)([-[:alnum:]\,\.\"\=\:\ \#\(\)\%\']*)>[[:space:]]*<tspan([-[:alnum:]\,\.\"\=\:\ \#\']*) x=\"([-[:digit:]\.\ ]+)\" y=\"([-[:digit:]\.\ ]+)\"([-[:alnum:]\,\.\"\=\:\ #]*)>([-–[:alnum:]\.\ \,\{\(\)\♭\♯\/]*)<\/tspan>/<text x=\"\4\" y=\"\5\"\2\3\6>\7/g"$i#removes the first tspan of a text element
#tspan to text if tspan has no coordinates
sed -ri -e ':a' -e 'N' -e '$!ba' -e "s/<text([-[:alnum:]\,\.\"\=\:\ \#\(\)]*) x=\"([-[:digit:]\.\ ]+)\" y=\"([-[:digit:]\.\ ]+)\"([-[:alnum:]\,\.\"\=\:\ \#\(\)\%\']*)>[[:space:]]*<tspan([-[:alnum:]\,\.\"\=\:\ \#\'\%]*)>([-–[:alnum:]\.\ \,\{\(\)]*)<\/tspan>/<text x=\"\2\" y=\"\3\"\1\4\5>\6/g"$i
it works in most cases but they can be buggy.
If you are interested to implement it I can post some more general test-examples.
Already asked in RazrFalcon/svgcleaner#127 and svg/svgo#964 , but not implemented till now.
The text was updated successfully, but these errors were encountered:
I would like to merge simple
<text>
with<tspan>
Inputexample:
Output:
actually I am using (case-depended) following scripts:
it works in most cases but they can be buggy.
If you are interested to implement it I can post some more general test-examples.
Already asked in RazrFalcon/svgcleaner#127 and svg/svgo#964 , but not implemented till now.
The text was updated successfully, but these errors were encountered: