Comments (4)
From what I understand, this is also how it should be 'worked around'. With taborder
you should be able to force it in. Is there any specific reason the href
has to be empty?
from minimize.
The link was being used to open a nav menu. It needed to be empty to not cause page navigation, we are using client side routing so could not use #. In the end we changed the ux pattern to not use the empty href.
The reason I reported it as an issue is that browsers behave differently if href is missing or empty. Minimizers should make the html as small as possible while still retaining the same behaviour should then not?
You can set taborder but that is the way to madness and bad ux as things invariably get out of order. Better to use the natural flow of the html to define the tab order. It makes including dynamic content more manageable.
from minimize.
I see, I would consider this an extreme edge case. One could argue browsers implement ambiguous behavior. Judging from your example though, wouldn't event.preventDefault
have prevented navigation?
The first intent is to maximize the minification. Where options relax this state, so in this case I think the option is more suitable. The option could even be accompanied by a plugin that does remove all empty attributes from other elements than a
. Which would then exactly do what you want.
from minimize.
event.preventDefault would work but I had listeners further up the dom than needed the event to bubble up.
I knew it was an edge case, as I said I have worked around the issue. I'm happy to respect your decision not to fix this issue that you feel too obscure.
from minimize.
Related Issues (20)
- An in-range update of cli-color is breaking the build 🚨 HOT 1
- An in-range update of uuid is breaking the build 🚨 HOT 1
- HTML Attribute Contenteditable Removed By Minimize
- HTML minification eats up spaces between inline elements HOT 3
- Maximum call stack size exceeded HOT 1
- Empty attributes are assigned blank values HOT 4
- This is beyond the scope of this project. NO, IT'S NOT HOT 3
- Django templates error HOT 8
- html tags are autoclosed within a single html file HOT 2
- Keep case HOT 1
- Empty space in attribute HOT 1
- Stripping off extra HTML tags HOT 4
- Minify inline JS - Package link broken? HOT 7
- minifying all HTML files recursively in folder HOT 1
- SSI only supports #includes
- Attribut draggable is no redundant attribute HOT 1
- Feat: remove development code
- Track elements are not considered void elements
- Version 10 of node.js has been released
- An in-range update of htmlparser2 is breaking the build 🚨 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 minimize.