File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -33,12 +33,16 @@ use Perl6::TypeGraph::Viz;
33
33
use Pod ::Convenience;
34
34
use Pod ::Htmlify;
35
35
use OO::Monitors;
36
-
36
+ # Don't include backslash in Win or forwardslash on Unix because they are used
37
+ # as directory seperators. These are handled in lib/Pod/Htmlify.pm6
38
+ my \badchars-ntfs = Qw [ / ? < > : * | " ] ;
39
+ my \badchars-unix = Qw [ ] ;
40
+ my \badchars = $ * DISTRO . is-win ?? badchars-ntfs !! badchars-unix;
37
41
{
38
42
my monitor PathChecker {
39
43
has % ! seen-paths ;
40
44
method check ($ path ) {
41
- note " $ path got badchar" if $ path . contains (any (qw [ \ % ? & = # + " ' : ~ < > ] ));
45
+ note " $ path got badchar" if $ path . contains (any (badchars ));
42
46
note " $ path got empty filename" if $ path . split (' /' )[* - 1 ] eq ' .html' ;
43
47
note " duplicated path $ path" if % ! seen-paths {$ path }: exists ;
44
48
% ! seen-paths {$ path }++ ;
Original file line number Diff line number Diff line change @@ -14,10 +14,11 @@ sub url-munge($_) is export {
14
14
return $ _ ;
15
15
}
16
16
17
- constant badchars = qw [ $ / \ . % ? & = # + " ' ~ < > | ]
18
- ~ (' :' if $ * DISTRO . is-win);
17
+ my \badchars-ntfs = Qw [ / ? < > \ : * | " ] ;
18
+ my \badchars-unix = Qw [ / ] ;
19
+ my \badchars = $ * DISTRO . is-win ?? badchars-ntfs !! badchars-unix;
19
20
my \goodnames = badchars. map : ' $' ~ *. uniname . subst (' ' , ' _' , : g);
20
- constant length = badchars. elems ;
21
+ my \ length = badchars. elems ;
21
22
22
23
sub escape-filename ($ s is copy ) is export {
23
24
# return $s if $s ~~ m{^ <[a..z]>+ '://'}; # bail on external links
You can’t perform that action at this time.
0 commit comments