Comments (5)
Ah, I see, you want people to use the new rel="external" attribute on anchor elements. IMHO all links containing a domain are to be considered external, what do you think?
from minify.
I too had this issue. I serve my sites only over https, and I already specify protocol for links only when sites do not support https, so for my own use I just removed the block of code that deals with this: tillberg@cfaa3ee (I'd be happy to turn that into a PR if desired, but it doesn't seem friendly to just go and create a PR for something that basically just nukes someone else's code :) )
I agree with @Knorkebrot above. I get that there might be some use case for trying to strip the protocol off of pages that include them in self-references (e.g. some heavy server-side application frameworks do this, I think), but that seems like a small benefit to get compared to requiring everyone to mark up their anchors with rel="external" whenever they need to force the link protocol. (I also had never heard of rel="external" before, so I might be biased by my own ignorance.)
from minify.
Yes you are right, it's not ideal. I will make changes to keep the protocol. It's a pity because stripping http:
can considerably reduce the size.
from minify.
Fixed in 3b07a59 on the develop branch. It will be re-enabled in the future when passing options is possible, including the currently used protocol. Either http or https can then be omitted, but not both.
from minify.
Please check the options
branch, it contains an implementation of passing options to the minifier. HTML now has the option scheme
which can be either http
or https
and it will remove only that protocol for links. Call m.Set("scheme", "http")
to enable that.
from minify.
Related Issues (20)
- Compile error in v2.20.8? HOT 2
- WARNING: preserve ownership not supported on platform HOT 11
- High CPU Usage After Minification HOT 3
- Since version 2.20.8 I got error "panic: runtime error: index out of range [nnn] with length nnn" HOT 3
- CSS with @layer is not well compressed HOT 1
- Minify private methods and private properties of JS classes HOT 3
- JS: "SyntaxError: Invalid or unexpected token" after minifying pdfmake.js HOT 1
- JS: '\u0022' minified to """ HOT 1
- Breaks on current jQuery versions HOT 2
- Comments beginning with # are not removed HOT 1
- Middleware skips some mimetype HOT 3
- Issues with deprecation of KeepConditionalComments HOT 1
- `minify` package for Alpine Linux doesn't show version. HOT 2
- File 1.css has a restrictive license, triggering license scanning software. HOT 2
- Regression error compiling jquery-1.12.4.js: unexpected /*! HOT 1
- Windows binary for release v2.20.16 contains a trojan HOT 4
- Windows binary only for HTML minification part HOT 1
- `--html-keep-quotes`, mixed single and double quotes in final output HOT 2
- Minified date file has to be the newest of input files HOT 5
- "ERROR: src is not part of root path: src= root=" when using --watch and --bundle options on windows HOT 2
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.