Skip to content

Commit

Permalink
Match pod that goes to the end (no =cut)
Browse files Browse the repository at this point in the history
Otherwise a =pod block w/o a =cut wasn't being matched as pod
  • Loading branch information
rwstauner committed Dec 16, 2011
1 parent da0e437 commit 3c1037c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/shBrushPerl.js
Expand Up @@ -59,7 +59,7 @@
// currently ignoring single quote package separator and utf8 names
{ regex: /(?:&|[$@%*]|\$#)[a-zA-Z_](\w+|::)*/g, css: 'variable' },
{ regex: /\b__(?:END|DATA)__\b[\s\S]*$/g, css: 'comments' },
{ regex: /^=\w[\s\S]*?\n=cut\s*$/gm, css: 'comments' }, // pod
{ regex: /(^|\n)=\w[\s\S]*?(\n=cut\s*\n|$)/g, css: 'comments' }, // pod
{ regex: new RegExp(this.getKeywords(funcs), 'gm'), css: 'functions' },
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
];
Expand Down
7 changes: 7 additions & 0 deletions tests/brushes/perl.html
Expand Up @@ -44,3 +44,10 @@
__DATA__
fake file handle
</script>
<script class="brush: perl;" type="syntaxhighlighter">
# comment

=head1 Foo

No 'cut' block, it just ends.
</script>

0 comments on commit 3c1037c

Please sign in to comment.