Skip to content

Commit aa56705

Browse files
committed
Make sure urls are uri_escape'd
Fixes problems with links to operators like % and / being unescaped.
1 parent 8093e18 commit aa56705

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

htmlify.p6

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ multi write-type-source($doc) {
221221
);
222222
$pod.content.push: pod-link(
223223
'Full-size type graph image as SVG',
224-
"/images/type-graph-$podname.svg",
224+
"/images/type-graph-{uri_escape $podname}.svg",
225225
);
226226

227227
my @mro = $type.mro;
@@ -233,7 +233,7 @@ multi write-type-source($doc) {
233233
pod-heading("Methods supplied by role $r"),
234234
pod-block(
235235
"$podname does role ",
236-
pod-link($r.name, "/type/$r"),
236+
pod-link($r.name, "/type/{uri_escape ~$r}"),
237237
", which provides the following methods:",
238238
),
239239
%methods-by-type{$r}.list,
@@ -245,7 +245,7 @@ multi write-type-source($doc) {
245245
pod-heading("Methods supplied by class $c"),
246246
pod-block(
247247
"$podname inherits from class ",
248-
pod-link($c.name, "/type/$c"),
248+
pod-link($c.name, "/type/{uri_escape ~$c}"),
249249
", which provides the following methods:",
250250
),
251251
%methods-by-type{$c}.list,
@@ -256,9 +256,9 @@ multi write-type-source($doc) {
256256
pod-heading("Methods supplied by role $r"),
257257
pod-block(
258258
"$podname inherits from class ",
259-
pod-link($c.name, "/type/$c"),
259+
pod-link($c.name, "/type/{uri_escape ~$c}"),
260260
", which does role ",
261-
pod-link($r.name, "/type/$r"),
261+
pod-link($r.name, "/type/{uri_escape ~$r}"),
262262
", which provides the following methods:",
263263
),
264264
%methods-by-type{$r}.list,

lib/Perl6/Documentable.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Perl6::Documentable {
3535
method url() {
3636
$!url //= $.kind eq 'operator'
3737
?? "/language/operators#" ~ uri_escape("@.subkinds[] $.name".subst(/\s+/, '_', :g))
38-
!! "/$.kind/$.name"
38+
!! ("", $.kind, $.name).map(&uri_escape).join('/')
3939
;
4040
}
4141
method categories() {

0 commit comments

Comments
 (0)