<?php $buffer = <<<HTML <p>This is an XPath: <code>/HTML/BODY/*[1][self::DIV]</code></p> <p>This is a Script:</p> <pre class="wp-block-code"><code><script> /* example script */ </script></code></pre> <p data-od-xpath="/HTML/BODY//*[4][self::P]">This has an XPath in a data attribute.</p> <pre class="wp-block-code"><code><style> /* example style */ </style></code></pre> HTML; // The following line comes from <https://plugins.trac.wordpress.org/browser/aruba-hispeed-cache/tags/2.0.24/src/AHSC_HtmlOptimizer.php#L16>: $buffer_after_comments_removed = preg_replace( '@\/\*(.*?)\*\/@s', ' ', $buffer ); //remove comment if ( $buffer_after_comments_removed === $buffer ) { echo "PASS\n"; } else { echo "FAIL\n"; } echo "\n"; echo "Result after regex attempts to remove comments:\n"; echo "\n"; echo "$buffer_after_comments_removed";
You have javascript disabled. You will not be able to edit any code.