{"pull_request":{"merged_at":"2011-12-16T21:46:37Z","user":{"id":129203,"login":"jmm","url":"https://api.github.com/users/jmm","avatar_url":"https://secure.gravatar.com/avatar/c5ac881a610d473635fa13c18d8b7719?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"c5ac881a610d473635fa13c18d8b7719"},"created_at":"2011-08-09T00:39:36Z","title":"Fixed highlighting of PHP when mixed with HTML","updated_at":"2011-12-16T21:46:37Z","review_comments":0,"state":"closed","id":261310,"patch_url":"https://github.com/alexgorbatchev/SyntaxHighlighter/pull/4.patch","html_url":"https://github.com/alexgorbatchev/SyntaxHighlighter/pull/4","closed_at":"2011-12-16T21:46:37Z","deletions":2,"mergeable":null,"issue_url":"https://github.com/alexgorbatchev/SyntaxHighlighter/issues/4","base":{"user":{"id":65633,"login":"alexgorbatchev","url":"https://api.github.com/users/alexgorbatchev","avatar_url":"https://secure.gravatar.com/avatar/a15c524f516ac52bfcc8a4c99dddd625?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"a15c524f516ac52bfcc8a4c99dddd625"},"ref":"master","sha":"eb7e490f4dd3884868ce1d248ef03fe2263c498d","repo":{"open_issues":49,"created_at":"2010-12-16T02:36:20Z","watchers":491,"git_url":"git://github.com/alexgorbatchev/SyntaxHighlighter.git","updated_at":"2011-12-16T21:46:36Z","fork":false,"id":1173043,"language":"PHP","html_url":"https://github.com/alexgorbatchev/SyntaxHighlighter","name":"SyntaxHighlighter","description":"SyntaxHighlighter is a fully functional self-contained code syntax highlighter developed in JavaScript.","master_branch":null,"forks":93,"url":"https://api.github.com/repos/alexgorbatchev/SyntaxHighlighter","ssh_url":"git@github.com:alexgorbatchev/SyntaxHighlighter.git","clone_url":"https://github.com/alexgorbatchev/SyntaxHighlighter.git","pushed_at":"2011-12-16T21:46:36Z","owner":{"id":65633,"login":"alexgorbatchev","url":"https://api.github.com/users/alexgorbatchev","avatar_url":"https://secure.gravatar.com/avatar/a15c524f516ac52bfcc8a4c99dddd625?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"a15c524f516ac52bfcc8a4c99dddd625"},"homepage":"http://alexgorbatchev.com/SyntaxHighlighter/","size":320,"svn_url":"https://svn.github.com/alexgorbatchev/SyntaxHighlighter","private":false},"label":"alexgorbatchev:master"},"body":"I noticed that when used with the html-script option, SyntaxHighlighter didn't highlight PHP code between a PHP start tag and the end of the code snippet, when the PHP code goes to the end of the snippet and there is no PHP end tag.  By \"the end of the code snippet\", I mean what would be EOF if the code were in a file.\r\n\r\nThe PHP end tag is not required at the end of a file, and omitting it is considered a best practice in files that are not supposed to generate any output (such as a file that defines a class and is meant to be included by other scripts).\r\n\r\nHere is a really minimal example of the situation I'm talking about:\r\n\r\n```\r\n\r\n<div class=\"whatever\">\r\nBlah blah blah.\r\n</div>\r\n\r\n<?php\r\n\r\n$something = \"something\";\r\n\r\n```\r\n\r\n\r\nI modified SyntaxHighlighter to highlight PHP code in that situation.  I did that by adding a boolean property, `eof_end`, to `phpScriptTags`, then checking for that in `forHtmlScript()` and adding end of line (\"$\") as an alternative pattern to the end tag.\r\n\r\nI eventually noticed that `phpScriptTags` is also used for the Perl brush, and I don't know if Perl behaves the same as PHP (closing tag at EOF not necessary), so perhaps the information represented by `eof_end` needs to be set in the PHP brush instead. \r\n\r\nOr perhaps PHP and Perl need separate variables to define their start / end tag regexes.  Particularly because I changed `phpScriptTags.left` so that it can match `<?php`.  After I added the `eof_end` functionality, SyntaxHighlighter still wasn't highlighting everything quite right.  When using `<?php` as the start tag and not using a corresponding end tag (because the PHP code goes to EOF), it was highlighting the `<?` but not the `php`.\r\n\r\nPersonally, I'm not even sure I want it highlighting the PHP start and end tags when mixed with HTML.  It doesn't highlight them when not mixed with HTML.  But if it is going to highlight them, then I want it to apply the same highlighting to start tags that have a corresponding end tag, and start tags that don't have an end tag because the PHP code goes to EOF.\r\n\r\nJesse\r\n\r\n","commits":1,"number":4,"additions":12,"url":"https://api.github.com/repos/alexgorbatchev/SyntaxHighlighter/pulls/4","merged_by":{"id":65633,"login":"alexgorbatchev","url":"https://api.github.com/users/alexgorbatchev","avatar_url":"https://secure.gravatar.com/avatar/a15c524f516ac52bfcc8a4c99dddd625?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"a15c524f516ac52bfcc8a4c99dddd625"},"diff_url":"https://github.com/alexgorbatchev/SyntaxHighlighter/pull/4.diff","_links":{"review_comments":{"href":"https://api.github.com/repos/alexgorbatchev/SyntaxHighlighter/pulls/4/comments"},"html":{"href":"https://github.com/alexgorbatchev/SyntaxHighlighter/pull/4"},"self":{"href":"https://api.github.com/repos/alexgorbatchev/SyntaxHighlighter/pulls/4"},"comments":{"href":"https://api.github.com/repos/alexgorbatchev/SyntaxHighlighter/issues/4/comments"}},"comments":0,"head":{"user":{"id":129203,"login":"jmm","url":"https://api.github.com/users/jmm","avatar_url":"https://secure.gravatar.com/avatar/c5ac881a610d473635fa13c18d8b7719?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"c5ac881a610d473635fa13c18d8b7719"},"ref":"php_html","sha":"28028706d9e3bb4a23ed1b532b26b67d15c9a807","repo":{"open_issues":0,"created_at":"2011-08-08T16:19:22Z","watchers":1,"git_url":"git://github.com/jmm/SyntaxHighlighter.git","updated_at":"2011-10-04T17:46:55Z","fork":true,"id":2174403,"language":"PHP","html_url":"https://github.com/jmm/SyntaxHighlighter","name":"SyntaxHighlighter","description":"SyntaxHighlighter is a fully functional self-contained code syntax highlighter developed in JavaScript.","master_branch":null,"forks":0,"url":"https://api.github.com/repos/jmm/SyntaxHighlighter","ssh_url":"git@github.com:jmm/SyntaxHighlighter.git","clone_url":"https://github.com/jmm/SyntaxHighlighter.git","pushed_at":"2011-08-08T23:40:28Z","owner":{"id":129203,"login":"jmm","url":"https://api.github.com/users/jmm","avatar_url":"https://secure.gravatar.com/avatar/c5ac881a610d473635fa13c18d8b7719?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"c5ac881a610d473635fa13c18d8b7719"},"homepage":"http://alexgorbatchev.com/SyntaxHighlighter/","size":132,"svn_url":"https://svn.github.com/jmm/SyntaxHighlighter","private":false},"label":"jmm:php_html"},"changed_files":1,"merged":true},"number":4,"action":"closed"}