Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG elements white space getting stripped #211

Open
jordwalke opened this issue Jul 21, 2020 · 3 comments
Open

SVG elements white space getting stripped #211

jordwalke opened this issue Jul 21, 2020 · 3 comments

Comments

@jordwalke
Copy link

jordwalke commented Jul 21, 2020

the following:

         <g id="g1">
            <text x="0" textLength="40" class="color1">test </text>
            <text x="40" textLength="8" class="color4">~</text>
            <text x="48" textLength="24" class="color1"> $ </text>
            <text x="72" textLength="8" class="background"> </text>
         </g>

Is getting inlined as:

         <g id="g1">
            <text textLength="40" class="color1">test</text>
            <text x="40" textLength="8" class="color4">~</text>
            <text x="48" textLength="24" class="color1">$</text>
            <text x="72" textLength="8" class="background"/>
         </g>

See that the trailing whitespace of test is getting trimmed and the space around the $ as well.

@jordwalke
Copy link
Author

This is only when including svg as an image:

        <img src="./foo.svg" alt="Example" style="max-width:100%;">

@jordwalke
Copy link
Author

This issue only happens when I have
nosvg: false,

Perhaps this is expected? Sorry for the trouble.

@cimm
Copy link

cimm commented Nov 28, 2020

I would like my SVG images to be inlined like a script, not like an image. Currently inliner encodes an SVG images as a base64 string. Rasterizes the SVG image defeats the whole idea of an SVG images (resolution independence, selectable text, etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants