Parcourir la source

【修复】访问目录无法定位到 index.md

PJ568 il y a 2 ans
Parent
commit
74a87e5e8c
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 4 1
      index.html

+ 4 - 1
index.html

@@ -3,7 +3,7 @@
 <!-- 作者:PJ568 -->
 <!-- 项目地址:https://github.com/PJ-568/markdown.html/ -->
 <!-- 本项目遵循 CC BY-SA 4.0 International 许可协议 -->
-<!-- v 0.6.2 -->
+<!-- v 0.6.3 -->
 
 <head>
   <meta charset="utf-8">
@@ -283,6 +283,9 @@
         if (path) {
           path = new URL(path, 'http://example.com').pathname;
           if (!path.endsWith('.md')) {
+            if (!path.endsWith('/')) {
+              path += '/';
+            }
             path += 'index.md';
           }
         }