Skip to content

Commit ed6e2f9

Browse files
committed
fix syntax highlighter handling of =cut
perl terminates pod sections with a =cut directive, but is very loose about how it parses it. Update the syntax highlighter regex to match how perl handles this. It doesn't match the pod spec, but this is primarily doing highlighting on perl code, not pod.
1 parent efa4055 commit ed6e2f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

root/static/js/brush-perl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function Brush() {
9595

9696
// don't capture the newline after =cut so that =cut\n\n=head1 will start a new pod section
9797
{
98-
regex: /(^|\n)=\w[\s\S]*?(\n=cut\s*(?=\n)|$)/g,
98+
regex: /(^|\n)=\w[\s\S]*?(\n=cut(?![a-zA-Z]).*)/g,
9999
css: 'comments'
100100
}, // pod
101101

0 commit comments

Comments
 (0)