Skip to content

Commit

Permalink
fix syntax highlighter handling of =cut
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
haarg committed Nov 18, 2024
1 parent efa4055 commit ed6e2f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion root/static/js/brush-perl.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function Brush() {

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

Expand Down

0 comments on commit ed6e2f9

Please sign in to comment.