From ed6e2f98e5e1445108b2b785c00a915932769f39 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Mon, 18 Nov 2024 15:04:14 +0100 Subject: [PATCH] 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. --- root/static/js/brush-perl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/static/js/brush-perl.js b/root/static/js/brush-perl.js index 9ff56658475..367947f929d 100644 --- a/root/static/js/brush-perl.js +++ b/root/static/js/brush-perl.js @@ -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