![]() We now indent the line that contains B: > The text is still right aligned, there is space between ta and il. We now put a single line break between ta and il: > Let’s replace the body of tspan with body and put tail in the text block (as tail of tspan): > Some simple testing supports my assumption (snippets’ first line is the closing bracket of, the rest is taken from the svg-file from this comment): ![]() Not an expert in SVG (and unfortunately no time to dig the specs): It appears to me that any character within a text block matters (newlines seem to be transformed to spaces). → It does, but the spaces are invisible (cf. It is interesting, that the first newline within the text bock (between and does not cause problems. The following svg-file, with this newline removed, produces the correct output: ![]() I have now tracked down the reason, it is a newline between and. (This issue was also mentioned in #8907 - I have shortened the example from over there, which interestingly led to a less pronounced effect.) Yet, the style key, whose value differs the most after formatting, is not the problem (I tried to use the value from the original, unforamtted file). So it has to do with some spacing I assume. I was not really able to track the reason for this down, however, I found that removal of xml:space="preserve" fixes the file: The screenshots above are from Inkscape, but the same behavior is seen when opening the files with Firefox. The rendered image should look the same before and after formatting. Prettier 2.2.1 Playground link -parser html
0 Comments
Leave a Reply. |