blackducksoftware / ohcount

The Ohloh source code line counter
https://github.com/blackducksoftware/ohcount
GNU General Public License v2.0
257 stars 74 forks source link

OTWO-5454 Fix php tag being identified as html #69

Closed notalex closed 5 years ago

notalex commented 5 years ago

The tests show that ohcount returns > instead of ?>. We haven't been able to fix this. However the line still counts as php, which serves our purpose.

PDegenPortnoy commented 5 years ago

Outstanding!

craigbarnes commented 5 years ago

The ?> token is the closing delimiter of an XML "processing instruction", which is also recognized and tolerated by HTML parsers. Counting it as HTML was correct.

PDegenPortnoy commented 5 years ago

@craigbarnes Thank you for your input. Acknowledging that ?> is valid HTML, ohcount was flagging it as HTML instead of PHP in PHP source code. The intent of this change was to ensure that PHP code was correctly counted.

There may be a new issue that when ?> is found in HTML, it is not being recognized, but we do not have any reports of that. Do you have a solution to the issue that the PHP code was being misclassified as HTML?