I find that Browsersync does not get injected automatically when there is not <body> tag is not in the HTML file. With my use-case, I am live-editing lots of HTML partials, which do no contain body tags, so this is awkward to have to inject a <body> tag when the system knows I'm editing a partial, and not inject a <body> tag when I'm loading a full page.
Steps to reproduce/test case
Setup
Install Browsersync as a global package:
npm install -g browser-sync
Testing Body Works
Create HTML file: test-working.html
<body>
<h1>Test Working</h1>
</body>
Run the following command and see that Browsersync works:
browser-sync start -s --startPath test-working.html
Testing No-Body Fails
Create HTML file: test-broken.html
<h1>Test Broken</h1>
Run the following command and see that Browsersync fails:
browser-sync start -s --startPath test-working.html
Issue details
I find that Browsersync does not get injected automatically when there is not
<body>
tag is not in the HTML file. With my use-case, I am live-editing lots of HTML partials, which do no contain body tags, so this is awkward to have to inject a<body>
tag when the system knows I'm editing a partial, and not inject a<body>
tag when I'm loading a full page.Steps to reproduce/test case
Setup
Install Browsersync as a global package:
npm install -g browser-sync
Testing Body Works
Create HTML file:
test-working.html
Run the following command and see that Browsersync works:
browser-sync start -s --startPath test-working.html
Testing No-Body Fails
Create HTML file:
test-broken.html
Run the following command and see that Browsersync fails:
browser-sync start -s --startPath test-working.html
Demo
I have created a demo here: https://github.com/F1LT3R/browsersync-body-demo
Please specify which version of Browsersync, node and npm you're running
Affected platforms
Browsersync use-case
If CLI, please paste the entire command below
browser-sync start -s --startPath
for all other use-cases, (gulp, grunt etc), please show us exactly how you're using Browsersync
I have created a demo here: https://github.com/F1LT3R/browsersync-body-demo