Right now, the only way to achieve whitespace presevation is by using xml:space.
According to mdn this is outdated.
Nowadays there is the whitespace css properly.
So whitespace: pre should show all whitespaces (including newlines).
This is supported by Firefox. Chrome only supports multiple whitespaces and no newlines.
I vote for implementing chromes behavior because its trivial to implement. Just add an extra condition to this line:
|
if (xmlSpace === 'default') { |
If it is possible we should look into rendering newlines as well but that would probably take a bit more effort
Right now, the only way to achieve whitespace presevation is by using xml:space.
According to mdn this is outdated.
Nowadays there is the
whitespacecss properly.So
whitespace: preshould show all whitespaces (including newlines).This is supported by Firefox. Chrome only supports multiple whitespaces and no newlines.
I vote for implementing chromes behavior because its trivial to implement. Just add an extra condition to this line:
svg2pdf.js/src/nodes/text.ts
Line 53 in de6f472
If it is possible we should look into rendering newlines as well but that would probably take a bit more effort