-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inject HTML tag if missing #654
Conversation
Codecov Report
@@ Coverage Diff @@
## master #654 +/- ##
==========================================
- Coverage 89.02% 88.57% -0.46%
==========================================
Files 61 61
Lines 1896 1900 +4
==========================================
- Hits 1688 1683 -5
- Misses 208 217 +9
Continue to review full report at Codecov.
|
So basically this would inject the |
@farskid - That's correct. Parcel already handles injecting the head for you if it isn't found. The body would also be possible. The body isn't required by the html5 spec though; it's left as an implementation detail for the browser to handle it. |
We should probably handle it. Browsers do, so HTML like this exists in the wild. Question: in the example from the issue, there is no Perhaps we should actually fix it as browsers do? There is probably a spec for this to determine how to insert the elements. Otherwise, since the tags are optional, we could just insert the element into the root content and not even bother adding an |
@brandon93s @devongovett Good point. in addition to what you said, in the example on issue, if I added the |
After some research and digging into WebKit, it looks like the Browsers will automatically break up your html into Adding With the above in mind, I propose the following strategy: This would remove the current code that adds the Thoughts? Will take a shot at implementation pending feedback. @devongovett |
Yeah that sounds like the right strategy. |
The above discussed strategy has been implemented. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work! ✨
* Inject HTML tag if missing * Update sibling bundle node insert logic
* Inject HTML tag if missing * Update sibling bundle node insert logic
Fixes #633 if we want to support this case.