[clang-tools-extra] 3fbc9b9 - [clang-doc] Correct improper file paths in HTML output (#132103)

via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 20 14:11:46 PDT 2025


Author: Paul Kirth
Date: 2025-03-20T14:11:42-07:00
New Revision: 3fbc9b9efc669a236ab21ab06f854bd9ad751af3

URL: https://github.com/llvm/llvm-project/commit/3fbc9b9efc669a236ab21ab06f854bd9ad751af3
DIFF: https://github.com/llvm/llvm-project/commit/3fbc9b9efc669a236ab21ab06f854bd9ad751af3.diff

LOG: [clang-doc] Correct improper file paths in HTML output (#132103)

In index.js the logic of the ternary operator was backwards, preventing
us from generating the correct file paths, or relative paths in the HTML
output.

Added: 
    

Modified: 
    clang-tools-extra/clang-doc/assets/index.js

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clang-doc/assets/index.js b/clang-tools-extra/clang-doc/assets/index.js
index 6a223de66f84a..58a92f049f19f 100644
--- a/clang-tools-extra/clang-doc/assets/index.js
+++ b/clang-tools-extra/clang-doc/assets/index.js
@@ -2,8 +2,8 @@ function genLink(Ref) {
   // we treat the file paths 
diff erent depending on if we're
   // serving via a http server or viewing from a local
   var Path = window.location.protocol.startsWith("file") ?
-      `${window.location.protocol}//${window.location.host}/${Ref.Path}` :
-      `${window.location.protocol}//${RootPath}/${Ref.Path}`;
+      `${window.location.protocol}//${RootPath}/${Ref.Path}` :
+      `${window.location.protocol}//${window.location.host}/${Ref.Path}`;
   if (Ref.RefType === "namespace") {
     Path = `${Path}/index.html`
   } else if (Ref.Path === "") {


        


More information about the cfe-commits mailing list