Giter Site home page Giter Site logo

Comments (5)

stroborobo avatar stroborobo commented on May 14, 2024

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.

tillberg avatar tillberg commented on May 14, 2024

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.

tdewolff avatar tdewolff commented on May 14, 2024

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.

tdewolff avatar tdewolff commented on May 14, 2024

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.

tdewolff avatar tdewolff commented on May 14, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.