File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -41,12 +41,22 @@ sub rewrite-url($s) is export {
41
41
return $ s ;
42
42
}
43
43
44
+ when / ^ <[ A..Z ] > / {
45
+ $ r = " /type/{ uri_unescape($ s )} " ;
46
+ succeed;
47
+ }
48
+
49
+ when / ^ <[ a..z ] > | ^ <- alpha >* $ / {
50
+ $ r = " /routine/{ uri_unescape($ s )} " ;
51
+ succeed;
52
+ }
53
+
44
54
# special case the really nasty ones
45
55
when / ^ '/routine//' $ / { return ' /routine/' ~ escape-filename(' /' ); succeed; }
46
56
when / ^ '/routine///' $ / { return ' /routine/' ~ escape-filename(' //' ); succeed; }
47
57
48
58
when / ^ ([ '/routine/' | '/syntax/' | '/language/' | '/programs/' | '/type/' ]) (<- [ #/ ] >+ ) [ ('#' ) (<- [ /# ] >+ ) ]* $ / {
49
- $ r = $0 ~ escape-filename($1 ) ~ $2 ~ uri_escape($3 );
59
+ $ r = $0 ~ escape-filename(uri_unescape( $1 ) ) ~ $2 ~ uri_escape($3 );
50
60
succeed;
51
61
}
52
62
@@ -58,7 +68,6 @@ sub rewrite-url($s) is export {
58
68
}
59
69
60
70
my $ file-part = $ r . split (' #' )[0 ] ~ ' .html' ;
61
-
62
71
die " $ file-part not found" unless $ file-part . IO : e: f: s;
63
72
64
73
return $ r ;
You can’t perform that action at this time.
0 commit comments