marvin-zhao / google-code-prettify

Automatically exported from code.google.com/p/google-code-prettify
Apache License 2.0
0 stars 0 forks source link

Perl syntax highlighting does not recognize POD and highlights quotes in comments #354

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Perl syntax highlighting in google-code-prettify has 2 problems:

1) POD (Plain Old Documentation) and __END__ are not recognized at all. POD is 
everything between =something and =end; everything after __END__ is also not 
parsed, so should be treated as a comment.

Example of incorrect highlighting using current prettify:

http://vmx.yourcmc.ru/var/tmp/Field.htm

Just trying to add a rule for POD doesn't work because of 
shortcutStylePatterns.push([PR_PLAIN, /^\s+/, null, ' \r\n\t\xA0']);

So I've commented this line in the patch. I think it's anyway useless.

3) And after fixing POD, there is still a problem with quotes in comments - 
prettify treats a quote inside comment as a beginning of string! Example:

http://vmx.yourcmc.ru/var/tmp/Field_pod.htm

(see incorrect highlighting in SQL_DEFINITIONS)

This is fixed by adding # as a character in the definition of punctuation...

Example with both problems fixed:

http://vmx.yourcmc.ru/var/tmp/Field_fixed.htm

Patch is attached.

Original issue reported on code.google.com by vita...@yourcmc.ru on 28 Oct 2014 at 2:01

Attachments: