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

Html Entities inside inline SVG do not render correctly #5144

Closed
5 tasks done
blemelin opened this issue Jul 11, 2021 · 6 comments
Closed
5 tasks done

Html Entities inside inline SVG do not render correctly #5144

blemelin opened this issue Jul 11, 2021 · 6 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution external This issue is caused by an external dependency and not Docusaurus.

Comments

@blemelin
Copy link

blemelin commented Jul 11, 2021

🐛 Bug Report

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io
  • I have read the console error message carefully (if applicable)

Description

Html entities inside inline svg does not render correctly. They seems to be escaped twice.

Have you read the Contributing Guidelines on issues?

Yes

Steps to reproduce

Here are the steps to reproduce the issue.

  1. Create a SVG with special characters like < or >.
  2. Add it to any doc by inlining it (see this)

Expected behavior

image

Actual behavior

image

For your information, I can use the <img> tag and it works just fine, but I need the text to be selectable (yeah...that's a weird requirement...I know....).

Your environment

  • Windows 10 Build 19042.1083
  • Firefox 89.2.2
  • NodeJs 7.3.0

Reproducible demo

Live Demo : [Deleted]
Repo : [Deleted]
intro.md file : [Deleted]

@blemelin blemelin added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Jul 11, 2021
@lex111
Copy link
Contributor

lex111 commented Jul 12, 2021

Fix for this bug here -> gregberge/svgr#553, so we will wait for merge that.

@Josh-Cena
Copy link
Collaborator

Should be fixed

@lex111
Copy link
Contributor

lex111 commented Oct 30, 2021

Actually, this is not fixed. However, a new major version (in alpha stage) of svgr/webpack has been released which fixes this issue. Therefore, @blemelin you can upgrade your local dependency "@svgr/webpack" to "v6.0.0-alpha.0" to resolve the bug. We on our part, will wait for more stable version.

@Josh-Cena
Copy link
Collaborator

In that case let's reopen & wait for the version bump on our side🤷‍♂️

@lex111
Copy link
Contributor

lex111 commented Dec 4, 2021

Resolved in #5958.

However since @svgr/webpack dependency is explicitly listed in the package.json when initializing of Docusaurus site, this library must be manually updated to "^6.0.0".

@lex111 lex111 closed this as completed Dec 4, 2021
@Josh-Cena
Copy link
Collaborator

However since @svgr/webpack dependency is explicitly listed in the package.json when initializing of Docusaurus site, this library must be manually updated to "^6.0.0".

I guess it's actually fine, because in our core we prioritize node_modules of the core itself to the site's node_modules so that the deps is always the version required by the core

@Josh-Cena Josh-Cena added external This issue is caused by an external dependency and not Docusaurus. and removed status: needs triage This issue has not been triaged by maintainers labels Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution external This issue is caused by an external dependency and not Docusaurus.
Projects
None yet
Development

No branches or pull requests

3 participants