Comments (3)
Good point, this should be fixed in the latest release!
from minify.
Thanks for raising this issue. The XMLNS attribute should only be removed when the SVG document is "inline". This is only activated for SVG elements inside HTML. Otherwise, a regular SVG document is not considered inline and should thus not remove the XMLNS attribute. It is strange that this does happen for you, could you show me an example that reproduce this behaviour?
from minify.
Sorry for the lack of examples.
After further investigation, it appears to be a random bug.
It seems to happen about 70% of the time.
Since it was not possible to check without a certain number of files,
I will provide an example of a repository where the error occurs.
go install github.com/tdewolff/minify/v2/cmd/minify@latest
git clone https://github.com/marmooo/touch-kanji
cd touch-kanji
minify src/favicon/favicon.svg # --> ok
minify -r docs -o . # --> sometimes fail
The easiest way to check is to enter the following commands:
cd touch-kanji
minify -r docs -o .
git status # <-- if docs/favicon/favicon.svg is added, it's a bug.
from minify.
Related Issues (20)
- Python can't find _minify.so HOT 1
- System Package Releases HOT 1
- TemplateDelims can eat an entire range operator HOT 1
- javascript with calls to String.raw gets incorrectly minified HOT 17
- Vulnerable version of moment referenced by Javascript unit tests HOT 2
- Minify incorrectly removes spaces after `</code>` element that contains a template HOT 1
- SVG xmlns attribute could be stripped when inside HTML documents HOT 2
- Builds fails on 32 bit systems HOT 9
- fails to correctly minify undici HOT 9
- Minifying CSS in a HTML document which uses Mustache template, incorrectly minifies HOT 4
- How to minify HTML, but only HTML and JS i.e. excluding CSS HOT 2
- Javascript option to preserve string newline or char codes HOT 8
- XML CDATA minify issue HOT 12
- Minifier always transforms `!(string)` to `!1` even if the string is empty. HOT 1
- Removing parenthesis of expression containing optional chaining can make different output HOT 1
- Accessing property of object should be considered as side effect-able expression. HOT 3
- CLI doesn't handle directory inputs with trailing forward slashes on Windows HOT 1
- `npm i @tdewolff/minify` fails on Windows HOT 3
- `undefined` can be redeclared in function body
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minify.