html-minifier
html-minifier copied to clipboard
PHP breaks when "?>" exist in string(s) or comment(s)
When ?>
exist in a comment or string, the PHP breaks.
The expected result should be the same as the input.
Before:
<?php
//this does not get formatted.
define("cars", [
"Alfa Romeo",
"BMW", //this "?>" will break the PHP.
"Toyota"
]);
//this get formatted. <h1 class="">
echo cars[0];
?>
After:
<?php
//this does not get formatted.
define("cars", [
"Alfa Romeo",
"BMW", //this "?>" will break the PHP. "Toyota" ]); //this get formatted.<h1>echo cars[0]; ?>