From e347b26cf69f91572d8fa1989685d3d2aadee755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20K=2EF=2E=20H=C3=B6lzenspies?= Date: Tue, 26 Mar 2024 16:16:02 +0100 Subject: [PATCH] Avoid resolving paths on fragments (#357) Fixes an issue where modules with fragment paths are resolved against the URI path. --- pkl-doc/src/main/kotlin/org/pkl/doc/DocPackageInfo.kt | 2 +- .../output/localhost:0/birds/0.5.0/Bird/index.html | 2 +- .../output/localhost:0/birds/0.5.0/allFruit/index.html | 2 +- .../output/localhost:0/birds/0.5.0/catalog/index.html | 2 +- .../output/localhost:0/fruit/1.1.0/Fruit/index.html | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkl-doc/src/main/kotlin/org/pkl/doc/DocPackageInfo.kt b/pkl-doc/src/main/kotlin/org/pkl/doc/DocPackageInfo.kt index 785ee2d1..38cfd286 100644 --- a/pkl-doc/src/main/kotlin/org/pkl/doc/DocPackageInfo.kt +++ b/pkl-doc/src/main/kotlin/org/pkl/doc/DocPackageInfo.kt @@ -161,7 +161,7 @@ data class DocPackageInfo( "pkl:/" -> "pkl:${moduleName.substring(4)}".toUri() else -> { val path = getModulePath(moduleName, moduleNamePrefix).uriEncoded + ".pkl" - URI(importUri).resolve(path) + URI(importUri + path) } } diff --git a/pkl-doc/src/test/files/DocGeneratorTest/output/localhost:0/birds/0.5.0/Bird/index.html b/pkl-doc/src/test/files/DocGeneratorTest/output/localhost:0/birds/0.5.0/Bird/index.html index f7a6f0f2..d2c84df9 100644 --- a/pkl-doc/src/test/files/DocGeneratorTest/output/localhost:0/birds/0.5.0/Bird/index.html +++ b/pkl-doc/src/test/files/DocGeneratorTest/output/localhost:0/birds/0.5.0/Bird/index.html @@ -28,7 +28,7 @@
open module birds.Bird
Module URI:
-
package://localhost:0/Bird.pklcontent_copy
+
package://localhost:0/birds@0.5.0#/Bird.pklcontent_copy
Source code:
Bird.pkl
diff --git a/pkl-doc/src/test/files/DocGeneratorTest/output/localhost:0/birds/0.5.0/allFruit/index.html b/pkl-doc/src/test/files/DocGeneratorTest/output/localhost:0/birds/0.5.0/allFruit/index.html index 8df77427..7db63516 100644 --- a/pkl-doc/src/test/files/DocGeneratorTest/output/localhost:0/birds/0.5.0/allFruit/index.html +++ b/pkl-doc/src/test/files/DocGeneratorTest/output/localhost:0/birds/0.5.0/allFruit/index.html @@ -28,7 +28,7 @@
module birds.allFruit
Module URI:
-
package://localhost:0/allFruit.pklcontent_copy
+
package://localhost:0/birds@0.5.0#/allFruit.pklcontent_copy
Source code:
allFruit.pkl
diff --git a/pkl-doc/src/test/files/DocGeneratorTest/output/localhost:0/birds/0.5.0/catalog/index.html b/pkl-doc/src/test/files/DocGeneratorTest/output/localhost:0/birds/0.5.0/catalog/index.html index 0af0f836..fe891690 100644 --- a/pkl-doc/src/test/files/DocGeneratorTest/output/localhost:0/birds/0.5.0/catalog/index.html +++ b/pkl-doc/src/test/files/DocGeneratorTest/output/localhost:0/birds/0.5.0/catalog/index.html @@ -28,7 +28,7 @@
module birds.catalog
Module URI:
-
package://localhost:0/catalog.pklcontent_copy
+
package://localhost:0/birds@0.5.0#/catalog.pklcontent_copy
Source code:
catalog.pkl
diff --git a/pkl-doc/src/test/files/DocGeneratorTest/output/localhost:0/fruit/1.1.0/Fruit/index.html b/pkl-doc/src/test/files/DocGeneratorTest/output/localhost:0/fruit/1.1.0/Fruit/index.html index 25c70f28..c1acf960 100644 --- a/pkl-doc/src/test/files/DocGeneratorTest/output/localhost:0/fruit/1.1.0/Fruit/index.html +++ b/pkl-doc/src/test/files/DocGeneratorTest/output/localhost:0/fruit/1.1.0/Fruit/index.html @@ -28,7 +28,7 @@
module fruit.Fruit
Module URI:
-
package://localhost:0/Fruit.pklcontent_copy
+
package://localhost:0/fruit@1.1.0#/Fruit.pklcontent_copy