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

Fetching HTML file that contains multiple SVGs returns broken data #2986

Open
StephenHassall opened this issue Aug 14, 2024 · 0 comments
Open

Comments

@StephenHassall
Copy link

This is a bug report.

If you fetch a HTML file that contains the following text, but without any head, body, etc.

<div>
  <svg
    viewBox="0 0 16 16"
    style="
      display: block;
      min-width: 16px;
      min-height: 16px;
      fill: none;
      stroke: black;
      stroke-width: 2.5;
      stroke-linecap: round;
      stroke-linejoin: round;">
    <path d="M 13,12 9,8 13,4"></path>
    <path d="M 7,12 3,8 7,4"></path>
  </svg>
</div>
<div>
  <svg
    viewBox="0 0 16 16"
    style="
      display: block;
      min-width: 16px;
      min-height: 16px;
      fill: none;
      stroke: black;
      stroke-width: 2.5;
      stroke-linecap: round;
      stroke-linejoin: round;">
    <path d="M 13,12 9,8 13,4"></path>
    <path d="M 7,12 3,8 7,4"></path>
  </svg>
</div>

It will add some inserted code (which is okay)...

<div>
  <svg
    viewBox="0 0 16 16"
    style="
      display: block;
      min-width: 16px;
      min-height: 16px;
      fill: none;
      stroke: black;
      stroke-width: 2.5;
      stroke-linecap: round;
      stroke-linejoin: round;">
    <path d="M 13,12 9,8 13,4"></path>
    <path d="M 7,12 3,8 7,4"></path>
  <!-- Code injected by live-server -->
<script>
	// <![CDATA[  <-- For SVG support ....
</script>
</svg>
</div>

But the second code injection ends abruptly.

<div>
  <svg
    viewBox="0 0 16 16"
    style="
      display: block;
      min-width: 16px;
      min-height: 16px;
      fill: none;
      stroke: black;
      stroke-width: 2.5;
      stroke-linecap: round;
      stroke-linejoin: round;">
    <path d="M 13,12 9,8 13,4"></path>
    <path d="M 7,12 3,8 7,4"></path>
  <!-- Code inject

There is nothing after the word inject.

  • Live Server: v5.7.9
  • Platform: Windows
  • Visual Studio Code: 1.92.1
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

1 participant