File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -256,6 +256,33 @@ async function run(
256256 file = activeFile ;
257257 }
258258
259+ // Handle extensionless URLs (e.g., "about" -> "about.html" or "about/index.html")
260+ if ( ! ext && pathName ) {
261+ // Try path.html first
262+ const htmlUrl = Url . join ( pathName , reqPath + ".html" ) ;
263+ const htmlFile = editorManager . getFile ( htmlUrl , "uri" ) ;
264+ if ( htmlFile ?. loaded && htmlFile . isUnsaved ) {
265+ sendHTML ( htmlFile . session ?. getValue ( ) , reqId ) ;
266+ return ;
267+ }
268+ const htmlFs = fsOperation ( htmlUrl ) ;
269+ if ( await htmlFs . exists ( ) ) {
270+ sendFileContent ( htmlUrl , reqId , MIMETYPE_HTML ) ;
271+ return ;
272+ }
273+
274+ // Try path/index.html
275+ const indexUrl = Url . join ( pathName , reqPath , "index.html" ) ;
276+ const indexFs = fsOperation ( indexUrl ) ;
277+ if ( await indexFs . exists ( ) ) {
278+ sendFileContent ( indexUrl , reqId , MIMETYPE_HTML ) ;
279+ return ;
280+ }
281+
282+ error ( reqId ) ;
283+ return ;
284+ }
285+
259286 switch ( ext ) {
260287 case ".htm" :
261288 case ".html" :
You can’t perform that action at this time.
0 commit comments