Skip to content

Commit 97f47cf

Browse files
committed
fix: ./ link does not work ad expected when open html as local file.
1 parent 6068774 commit 97f47cf

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/Publisher/Builder/template/layout.html

+1
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@
4141
<script src="script/inherited-summary.js"></script>
4242
<script src="script/test-summary.js"></script>
4343
<script src="script/inner-link.js"></script>
44+
<script src="script/patch-for-local.js"></script>
4445
</body>
4546
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
(function(){
2+
if (location.protocol === 'file:') {
3+
var elms = document.querySelectorAll('a[href="./"]');
4+
for (var i = 0; i < elms.length; i++) {
5+
elms[i].href = './index.html';
6+
}
7+
}
8+
})();

0 commit comments

Comments
 (0)