# Pastebin apCalljE @@ -248,11 +279,18 @@ sub process-pod-source(:$kind, :$pod, :$ } } +my %tm = <% percent # hash - dash . dot ? question>; +sub english-for-tokens { + $^a.comb.map({ %tm{$_} ?? "-%tm{$_}-" !! $_ }) + .join.subst(/'--'/, '-', :g) + .subst: /^\-|\-|\-|\-$/, '', :g +}; + # XXX: Generalize multi write-type-source($doc) { sub href_escape($ref) { # only valid for things preceded by a protocol, slash, or hash - return uri_escape($ref).subst('%3A%3A', '::', :g); + return uri_escape(english-for-tokens($ref)).subst('%3A%3A', '::', :g); } my $pod = $doc.pod; my $podname = $doc.name;