================
@@ -1,12 +1,19 @@
 function genLink(Ref) {
   var Path = 
`${window.location.protocol}//${window.location.host}/${Ref.Path}`;
+  var isFileProtocol = window.location.protocol.startsWith("file");
+  // we treat the file paths different depending on if we're
+  // serving via a http server or viewing from a local
+  if (isFileProtocol) {
+    Path = `${window.location.protocol}//${RootPath}/${Ref.Path}`;
+  }
   if (Ref.RefType !== "namespace") {
     if (Ref.Path === "") {
       Path = `${Path}${Ref.Name}.html`;
-    }
-    else {
+    } else {
       Path = `${Path}/${Ref.Name}.html`;
     }
+  } else {
+    Path = `${Path}/index.html`
   }
----------------
PeterChou1 wrote:

I don't think this will make a meaningful performance difference either way. 
Although I agree for readability purposes this is much more concise I've 
updated the code to reflect this

https://github.com/llvm/llvm-project/pull/93281
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to