mirror of
https://github.com/apple/pkl.git
synced 2026-03-26 02:51:13 +01:00
Fixes for pkldoc (#96)
* Add URI encoding to paths and fragments * Render quotes around identifiers when appropriate
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
// Arrays.asList("file:///pkl/.*", "https://.*\\.apple\\.com"));
|
||||
//
|
||||
// resolver.resolve("file:///pkl/foo.pkl", fileUrlModule, sourceSection);
|
||||
// resolver.resolve("https://pkl.io/foo.pkl", fileUrlModule, sourceSection);
|
||||
// resolver.resolve("https://example.com/foo.pkl", fileUrlModule, sourceSection);
|
||||
// }
|
||||
//
|
||||
// @Test(expected = EvalException.class)
|
||||
|
||||
Reference in New Issue
Block a user