[llvm-branch-commits] [clang-tools-extra] [clang-doc] Correct improper file paths in HTML output (PR #132103)
Paul Kirth via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Mar 19 14:09:37 PDT 2025
https://github.com/ilovepi created https://github.com/llvm/llvm-project/pull/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.
>From 6182de900b039f86b564ecf8b74fce8f07317d28 Mon Sep 17 00:00:00 2001
From: Paul Kirth <paulkirth at google.com>
Date: Wed, 19 Mar 2025 21:07:22 +0000
Subject: [PATCH] [clang-doc] Correct improper file paths in HTML output
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.
---
clang-tools-extra/clang-doc/assets/index.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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 different 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 llvm-branch-commits
mailing list