Skip to content

SVG code with formatting fails to load from memory #3357

Description

@psobolik

Is your issue REALLY a bug?

  • My issue is indeed a bug!
  • I am not crazy! I will not fill out this form just to ask a question or request a feature. Pinky promise.

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

svg(svg::Handle::from_memory(bytes)) fails if the bytes are derived from a string that contains formatting, like carriage returns or spaces/tabs. It works if the bytes are included in the source using include_bytes! because apparently that sanitizes the string.

What is the expected behavior?

The library might be expected to parse any valid SVG code, not only if it is compressed into a single line.
Here is a small project that shows the issue: https://codeberg.org/psobolik/iced-svg-fun.

Version

crates.io release

Operating System

Linux

Do you have any log output?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions