File tree 1 file changed +12
-4
lines changed
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) {
44
44
match : / < \/ b o d y > / i,
45
45
fn : function ( snippet , match ) {
46
46
// 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"' ) }
48
49
<script>
49
- // Fix /docs site configuration during tests
50
50
(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;
52
53
54
+ // Fix /docs site configuration during tests
53
55
aliasConfig['.*?/changelog'] = '/changelog.md';
56
+
57
+ // Enable BrowserSync snippet for non-IE browsers
58
+ if (!isIE) {
59
+ document.querySelector('#__bs_script__').removeAttribute('type');
60
+ }
54
61
})();
55
62
</script>
63
+ ${ match }
56
64
` ;
57
65
58
- return injectJS + snippet + match ;
66
+ return newSnippet ;
59
67
} ,
60
68
} ,
61
69
} ,
You can’t perform that action at this time.
0 commit comments