Skip to content

Source's HTML processing breaks inline SVG #158

@mik01aj

Description

@mik01aj

I guess it might be connected with Cheerio or whatever you use, but I'll just post it here.

When I put this in my spec:

<svg viewBox="0 0 8 16" style="margin-left:0.5em;width:8px;height:16px;position:absolute;top:6px;left:-15px;" data-reactid=".ujif4jny80.2.1.2.0">
  <path d="M8 0 L0 8 L8 16 Z" fill="white" data-reactid=".ujif4jny80.2.1.2.0.0">
  </path>
  <path d="M8 0 L0 8 L8 16" fill="none" stroke="rgba(0, 0, 0, 0.1)" data-reactid=".ujif4jny80.2.1.2.0.1">
  </path>
</svg>

I get this in HTML (as in HTTP response, this is not from Browser DOM):

<svg viewBox="0 0 8 16" style="margin-left:0.5em;width:8px;height:16px;position:absolute;top:6px;left:-15px;" data-reactid=".ujif4jny80.2.1.2.0">
  <path d="M8 0 L0 8 L8 16 Z" fill="white" data-reactid=".ujif4jny80.2.1.2.0.0">
    <path d="M8 0 L0 8 L8 16" fill="none" stroke="rgba(0, 0, 0, 0.1)" data-reactid=".ujif4jny80.2.1.2.0.1">
    </path>
  </path>
</svg>

And the SVG really looks different.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions