File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -44,18 +44,26 @@ function startServer(options = {}, cb = Function.prototype) {
4444 match : / < \/ b o d y > / i,
4545 fn : function ( snippet , match ) {
4646 // Override changelog alias to load local changelog (see routes)
47- const injectJS = `
47+ const newSnippet = `
48+ ${ snippet . replace ( / < s c r i p t [ ^ > ] * / , '$& type="text/plain"' ) }
4849 <script>
49- // Fix /docs site configuration during tests
5050 (function() {
51- const aliasConfig = (window && window.$docsify && window.$docsify.alias) || {};
51+ var aliasConfig = (window && window.$docsify && window.$docsify.alias) || {};
52+ var isIE = /*@cc_on!@*/false || !!document.documentMode;
5253
54+ // Fix /docs site configuration during tests
5355 aliasConfig['.*?/changelog'] = '/changelog.md';
56+
57+ // Enable BrowserSync snippet for non-IE browsers
58+ if (!isIE) {
59+ document.querySelector('#__bs_script__').removeAttribute('type');
60+ }
5461 })();
5562 </script>
63+ ${ match }
5664 ` ;
5765
58- return injectJS + snippet + match ;
66+ return newSnippet ;
5967 } ,
6068 } ,
6169 } ,
You can’t perform that action at this time.
0 commit comments