Skip to content

Commit c89a34a

Browse files
committed
Gives a bit of breathing space
1 parent 5acb576 commit c89a34a

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

lib/Pod/To/HTML.pm

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,20 @@ sub do-metadata returns Str {
209209
210210
#| Turns accumulated headings into a nested-C«<ol>» table of contents
211211
sub do-toc($pod) returns Str {
212-
my @levels is default(0) = 0;
213-
my proto sub find-headings($node, :$inside-heading){*}
214-
multi sub find-headings(Str $s is raw, :$inside-heading){ $inside-heading ?? $s.trim.&escape_html !! '' }
215-
multi sub find-headings(Pod::FormattingCode $node is raw where *.type eq 'C', :$inside-heading){
216-
my $html = $node.contents.map(*.&find-headings(:$inside-heading));
217-
$inside-heading ?? qq[<code class="pod-code-inline">{$html}</code>] !! ''
218-
}
219-
multi sub find-headings(Pod::Heading $node is raw, :$inside-heading){
212+
my @levels is default(0) = 0;
213+
214+
my proto sub find-headings($node, :$inside-heading){*}
215+
216+
multi sub find-headings(Str $s is raw, :$inside-heading){
217+
$inside-heading ?? $s.trim.&escape_html !! ''
218+
}
219+
220+
multi sub find-headings(Pod::FormattingCode $node is raw where *.type eq 'C', :$inside-heading){
221+
my $html = $node.contents.map(*.&find-headings(:$inside-heading));
222+
$inside-heading ?? qq[<code class="pod-code-inline">{$html}</code>] !! ''
223+
}
224+
225+
multi sub find-headings(Pod::Heading $node is raw, :$inside-heading){
220226
@levels.splice($node.level) if $node.level < +@levels;
221227
@levels[$node.level-1]++;
222228
my $level-hierarchy = @levels.join('.'); # e.g. §4.2.12

0 commit comments

Comments
 (0)