Fixes for pkldoc (#96)

* Add URI encoding to paths and fragments
* Render quotes around identifiers when appropriate
This commit is contained in:
Daniel Chao authored and GitHub committed 2024-02-08 11:28:34 -08:00
1 parent 9dc7eb2938
commit dddae1190f
126 files changed
+3234 -2560

No files matched your search

@@ -365,13 +365,13 @@ public final class IoUtils {
return uri;
}
var basePath = Path.of(base.getRawPath());
var basePath = Path.of(base.getPath());
if (!base.getRawPath().endsWith("/")) basePath = basePath.getParent();
var resultPath = basePath.relativize(Path.of(uri.getRawPath()));
var resultPath = basePath.relativize(Path.of(uri.getPath()));
try {
return new URI(
null, null, null, -1, resultPath.toString(), uri.getRawQuery(), uri.getRawFragment());
null, null, null, -1, resultPath.toString(), uri.getQuery(), uri.getFragment());
} catch (URISyntaxException e) {
throw new IllegalArgumentException(e);
}