question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

In Playground svgo option "removeXMLNS" not working

See original GitHub issue

🐛 Bug Report

Hi, looks like in SVGR Playground svgo option “removeXMLNS” not working

To Reproduce

  1. Open SVGR playground
  2. set svgo config to textarea:
{ 
  "plugins": [
    { "removeXMLNS": false }, 
    { "removeViewBox": false }, 
    { "cleanupIDs": false }
  ] 
}
  1. xmlns attribute still removes

Expected behavior

“xmlns” attribute must be in svg element

Maybe i doing something wrong, but it is not worked for me

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
MichaelGrubencommented, Oct 1, 2020

@krutoo in fact we use the svgProps property and this just works -> but we got icons with differing namespaces. All naturally have the basic xmlns but others have xmlns:xlink also. So currently we setup both namespaces (xmlns and xmlnsXlink) for all while running svgr on a folder.

I would prefer and expect from svgr that it takes the svgo-optimized svg (where its my turn to remove the NS) and removes nothing more -> the only task should be the transformation to a component. Especially if svgr will follow a valid standard (the NS is the only required attribute for the svg-tag - see https://www.w3.org/TR/SVG2/struct.html#Namespace if the svg is parsed as XML)

0reactions
gregbergecommented, Nov 15, 2020

Fixed in #498

Read more comments on GitHub >

github_iconTop Results From Across the Web

SVGR (SVGO) removeAttrs does not remove specified fill ...
When I manually remove fill attribute from generated <Path> in icon component I am able to change the fill via props. .svgo.yml configuration:...
Read more >
Options - SVGR
When removing dimensions, SVGO will be configured not to remove the viewBox if one is present. You can override this behaviour via your...
Read more >
Uncategorized – David Rickard's Tech Blog - engy.us
I created ts-npm-monorepo as a bare-bones example for how to set up a monorepo with Typescript using only NPM Workspaces. This is working...
Read more >
SVGOMG - SVGO's Missing GUI
SVGOMG. Powered by SVGO v3.0.0. Open SVG. Paste markup; Demo; Contribute. Image Markup. Global settings. Show original. Compare gzipped. Prettify markup
Read more >
手机端移动官网demo源码源码高亮模式在线查看|-51Aspx.com
... not-in-install[327B]; not-in-install.cmd[204B]; not-in-publish[327B] ... strip-indent[309B]; strip-indent.cmd[186B]; svgo[297B]; svgo.cmd[174B] ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found