File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -214,14 +214,14 @@ sub do-toc($pod) returns Str {
214
214
my proto sub find-headings ($ node , : $ inside-heading ){* }
215
215
multi sub find-headings (Str $ s is raw , : $ inside-heading ){ $ inside-heading ?? $ s . trim !! ' ' }
216
216
multi sub find-headings (Pod ::FormattingCode $ node is raw where *. type eq ' C' , : $ inside-heading ){
217
- my $ html = $ node . contents. map (*. & find-headings (: $ inside-heading ));
217
+ my $ html = $ node . contents. map (*. & find-headings (: $ inside-heading )). Str . & escape_html ;
218
218
$ inside-heading ?? qq [ <code class="pod-code-inline">{ $ html } </code> ] !! ' '
219
219
}
220
220
multi sub find-headings (Pod ::Heading $ node is raw , : $ inside-heading ){
221
221
@ levels . splice ($ node . level) if $ node . level < + @ levels ;
222
222
@ levels [$ node . level-1]++ ;
223
223
my $ level-hierarchy = @ levels . join (' .' ); # e.g. §4.2.12
224
- my $ text = $ node . contents. map (*. & find-headings (inside-heading => True ));
224
+ my $ text = $ node . contents. map (*. & find-headings (inside-heading => True )). Str . & escape_html ;
225
225
my $ link = escape_id(node2text($ node . contents));
226
226
qq [ <tr class="toc-level-{ $ node . level} "><td class="toc-number">{ $ level-hierarchy } </td><td class="toc-text"><a href="#$ link ">{ $ text } </a></td></tr>\n ] ;
227
227
}
You can’t perform that action at this time.
0 commit comments