diff --git a/pkl-doc/src/main/kotlin/org/pkl/doc/Util.kt b/pkl-doc/src/main/kotlin/org/pkl/doc/Util.kt
index 2064f4bc..cb1b1556 100644
--- a/pkl-doc/src/main/kotlin/org/pkl/doc/Util.kt
+++ b/pkl-doc/src/main/kotlin/org/pkl/doc/Util.kt
@@ -119,18 +119,11 @@ internal fun String.replaceSourceCodePlaceholders(
.replace("%{endLine}", sourceLocation.endLine.toString())
}
-/**
- * Encodes a URI string, encoding characters that are part of URI syntax.
- *
- * Follows `encodeURIComponent` from ECMAScript.
- */
+/** Encodes a URI string, encoding characters that are part of URI syntax. */
internal val String.uriEncodedComponent
get(): String {
- val ret = URLEncoder.encode(this, StandardCharsets.UTF_8)
- // Replace `+` with `%20` to be safe
- // (see
- // https://stackoverflow.com/questions/2678551/when-should-space-be-encoded-to-plus-or-20#:~:text=%20%20is%20a%20valid%20way,encodeURIComponent()%20does%20in%20JavaScript.)
- return ret.replace("+", "%20")
+ val ret = URI(null, null, this, null)
+ return ret.toString().replace("/", "%2F")
}
/**
@@ -144,8 +137,6 @@ internal val String.uriEncoded
fun getModulePath(moduleName: String, packagePrefix: String): String =
moduleName.substring(packagePrefix.length).replace('.', '/')
-internal fun String.toEncodedUri(): URI = URI(uriEncoded)
-
/**
* Turns `"foo.bar.baz-biz"` into ``"foo.bar.`baz-biz`"``.
*
diff --git a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/Module Containing Spaces/index.html b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/Module Containing Spaces/index.html
index 5ca600da..b6175f1e 100644
--- a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/Module Containing Spaces/index.html
+++ b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/Module Containing Spaces/index.html
@@ -64,8 +64,8 @@
Methods(show inherited)
-
-
- link
+
+
-
-
- expand_morelink
+
+
expand_morelink
@@ -89,10 +89,10 @@
-
-
-
-
- expand_morelink
+
+
+
+
expand_morelink
@@ -104,9 +104,9 @@
-
-
-
- link
+
+
+
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -131,9 +131,9 @@
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -145,8 +145,8 @@
-
-
- link
+
+
-
-
- link
+
+
-
-
-
- expand_morelink
+
+
+
expand_morelink
diff --git a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/baseModule/BaseClass.html b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/baseModule/BaseClass.html
index 9ccff287..427a1d9a 100644
--- a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/baseModule/BaseClass.html
+++ b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/baseModule/BaseClass.html
@@ -39,8 +39,8 @@
Methods(show inherited)
-
-
- link
+
+
-
-
- expand_morelink
+
+
expand_morelink
@@ -64,10 +64,10 @@
-
-
-
-
- expand_morelink
+
+
+
+
expand_morelink
@@ -79,9 +79,9 @@
-
-
-
- link
+
+
+
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -106,9 +106,9 @@
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -120,8 +120,8 @@
-
-
- link
+
+
-
-
- link
+
+
link
diff --git a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/baseModule/index.html b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/baseModule/index.html
index fb26cd7e..ddcbafae 100644
--- a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/baseModule/index.html
+++ b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/baseModule/index.html
@@ -75,8 +75,8 @@
Methods(show inherited)
-
-
- link
+
+
-
-
- expand_morelink
+
+
expand_morelink
@@ -100,10 +100,10 @@
-
-
-
-
- expand_morelink
+
+
+
+
expand_morelink
@@ -115,9 +115,9 @@
-
-
-
- link
+
+
+
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -142,9 +142,9 @@
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -156,8 +156,8 @@
-
-
- link
+
+
-
-
- link
+
+
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -201,8 +201,8 @@ path = rootModule.relativePathTo(module)
-
-
- link
+
+
link
diff --git a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classAnnotations/AnnotatedClass.html b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classAnnotations/AnnotatedClass.html
index f62d90cb..a676b44e 100644
--- a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classAnnotations/AnnotatedClass.html
+++ b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classAnnotations/AnnotatedClass.html
@@ -42,8 +42,8 @@
Methods(show inherited)
-
-
- link
+
+
-
-
- expand_morelink
+
+
expand_morelink
@@ -67,10 +67,10 @@
-
-
-
-
- expand_morelink
+
+
+
+
expand_morelink
@@ -82,9 +82,9 @@
-
-
-
- link
+
+
+
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -109,9 +109,9 @@
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -123,8 +123,8 @@
-
-
- link
+
+
-
-
- link
+
+
link
diff --git a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classAnnotations/AnnotatedClss.html b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classAnnotations/AnnotatedClss.html
index 42ae1529..c9a06f53 100644
--- a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classAnnotations/AnnotatedClss.html
+++ b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classAnnotations/AnnotatedClss.html
@@ -44,8 +44,8 @@
Methods(show inherited)
-
-
- link
+
+
-
-
- expand_morelink
+
+
expand_morelink
@@ -69,10 +69,10 @@
-
-
-
-
- expand_morelink
+
+
+
+
expand_morelink
@@ -84,9 +84,9 @@
-
-
-
- link
+
+
+
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -111,9 +111,9 @@
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -125,8 +125,8 @@
-
-
- link
+
+
-
-
- link
+
+
link
diff --git a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classAnnotations/AnnotatedClssWithExpandableComment.html b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classAnnotations/AnnotatedClssWithExpandableComment.html
index 8cc1e0cc..afdd5be8 100644
--- a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classAnnotations/AnnotatedClssWithExpandableComment.html
+++ b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classAnnotations/AnnotatedClssWithExpandableComment.html
@@ -44,8 +44,8 @@
Methods(show inherited)
-
-
- link
+
+
-
-
- expand_morelink
+
+
expand_morelink
@@ -69,10 +69,10 @@
-
-
-
-
- expand_morelink
+
+
+
+
expand_morelink
@@ -84,9 +84,9 @@
-
-
-
- link
+
+
+
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -111,9 +111,9 @@
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -125,8 +125,8 @@
-
-
- link
+
+
-
-
- link
+
+
link
diff --git a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classAnnotations/index.html b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classAnnotations/index.html
index 73faa2b0..c76b7d95 100644
--- a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classAnnotations/index.html
+++ b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classAnnotations/index.html
@@ -64,8 +64,8 @@
Methods(show inherited)
-
-
- link
+
+
-
-
- expand_morelink
+
+
expand_morelink
@@ -89,10 +89,10 @@
-
-
-
-
- expand_morelink
+
+
+
+
expand_morelink
@@ -104,9 +104,9 @@
-
-
-
- link
+
+
+
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -131,9 +131,9 @@
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -145,8 +145,8 @@
-
-
- link
+
+
-
-
- link
+
+
-
-
-
- expand_morelink
+
+
+
expand_morelink
diff --git a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments1.html b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments1.html
index 694367a5..4f4b8d90 100644
--- a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments1.html
+++ b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments1.html
@@ -39,8 +39,8 @@
Methods(show inherited)
-
-
- link
+
+
-
-
- expand_morelink
+
+
expand_morelink
@@ -64,10 +64,10 @@
-
-
-
-
- expand_morelink
+
+
+
+
expand_morelink
@@ -79,9 +79,9 @@
-
-
-
- link
+
+
+
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -106,9 +106,9 @@
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -120,8 +120,8 @@
-
-
- link
+
+
-
-
- link
+
+
link
diff --git a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments2.html b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments2.html
index 448297d7..c959743a 100644
--- a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments2.html
+++ b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments2.html
@@ -39,8 +39,8 @@
Methods(show inherited)
-
-
- link
+
+
-
-
- expand_morelink
+
+
expand_morelink
@@ -64,10 +64,10 @@
-
-
-
-
- expand_morelink
+
+
+
+
expand_morelink
@@ -79,9 +79,9 @@
-
-
-
- link
+
+
+
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -106,9 +106,9 @@
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -120,8 +120,8 @@
-
-
- link
+
+
-
-
- link
+
+
link
diff --git a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments3.html b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments3.html
index f28360c8..5c0252e9 100644
--- a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments3.html
+++ b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments3.html
@@ -40,8 +40,8 @@
Methods(show inherited)
-
-
- link
+
+
-
-
- expand_morelink
+
+
expand_morelink
@@ -65,10 +65,10 @@
-
-
-
-
- expand_morelink
+
+
+
+
expand_morelink
@@ -80,9 +80,9 @@
-
-
-
- link
+
+
+
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -107,9 +107,9 @@
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -121,8 +121,8 @@
-
-
- link
+
+
-
-
- link
+
+
link
diff --git a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments4.html b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments4.html
index 95d1c2ef..6987f954 100644
--- a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments4.html
+++ b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments4.html
@@ -44,8 +44,8 @@ Class with multi-line and multi-paragraph doc comment (paragraph2, line2).
Methods(show inherited)
-
-
- link
+
+
link
@@ -56,8 +56,8 @@ Class with multi-line and multi-paragraph doc comment (paragraph2, line2).
-
-
- expand_morelink
+
+
expand_morelink
@@ -69,10 +69,10 @@ Class with multi-line and multi-paragraph doc comment (paragraph2, line2).
-
-
-
-
- expand_morelink
+
+
+
+
expand_morelink
@@ -84,9 +84,9 @@ Class with multi-line and multi-paragraph doc comment (paragraph2, line2).
-
-
-
- link
+
+
+
link
@@ -97,9 +97,9 @@ Class with multi-line and multi-paragraph doc comment (paragraph2, line2).
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -111,9 +111,9 @@ Class with multi-line and multi-paragraph doc comment (paragraph2, line2).
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -125,8 +125,8 @@ Class with multi-line and multi-paragraph doc comment (paragraph2, line2).
-
-
- link
+
+
link
@@ -137,8 +137,8 @@ Class with multi-line and multi-paragraph doc comment (paragraph2, line2).
-
-
- link
+
+
link
diff --git a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments5.html b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments5.html
index 386ea2c3..729af661 100644
--- a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments5.html
+++ b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments5.html
@@ -40,8 +40,8 @@
Methods(show inherited)
-
-
- link
+
+
-
-
- expand_morelink
+
+
expand_morelink
@@ -65,10 +65,10 @@
-
-
-
-
- expand_morelink
+
+
+
+
expand_morelink
@@ -80,9 +80,9 @@
-
-
-
- link
+
+
+
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -107,9 +107,9 @@
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -121,8 +121,8 @@
-
-
- link
+
+
-
-
- link
+
+
link
diff --git a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments6.html b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments6.html
index 106def0b..bde70714 100644
--- a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments6.html
+++ b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments6.html
@@ -42,8 +42,8 @@
Methods(show inherited)
-
-
- link
+
+
-
-
- expand_morelink
+
+
expand_morelink
@@ -67,10 +67,10 @@
-
-
-
-
- expand_morelink
+
+
+
+
expand_morelink
@@ -82,9 +82,9 @@
-
-
-
- link
+
+
+
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -109,9 +109,9 @@
-
-
-
- expand_morelink
+
+
+
expand_morelink
@@ -123,8 +123,8 @@
-
-
- link
+
+
-
-
- link
+
+
link
diff --git a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments7.html b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments7.html
index 402795e1..b0519b75 100644
--- a/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments7.html
+++ b/pkl-doc/src/test/files/DocGeneratorTest/output/com.package1/1.2.3/classComments/Comments7.html
@@ -40,8 +40,8 @@
Methods(show inherited)
-
-
- link
+
+
-
-
- expand_morelink
+
+
expand_morelink
@@ -65,10 +65,10 @@
-
-
-
-
- expand_morelink
+
+
+
+
expand_morelink
@@ -80,9 +80,9 @@
-
-
-
-