When adding a Code block, I'm seeing a warning in the error log:
PHP Warning: DOMDocument::loadHTML(): Empty string supplied as input in /app/public/content/plugins/syntax-highlighting-code-block/vendor/scrivo/highlight.php/HighlightUtilities/functions.php on line 179
It should avoid calling splitCodeIntoArray() if $content is empty:
--- a/syntax-highlighting-code-block.php
+++ b/syntax-highlighting-code-block.php
@@ -510,7 +510,7 @@ function render_block( $attributes, $content ) {
require_highlight_php_functions();
$highlighted_lines = parse_highlighted_lines( $attributes['highlightedLines'] );
- $lines = \HighlightUtilities\splitCodeIntoArray( $content );
+ $lines = empty( $content ) ? [] : \HighlightUtilities\splitCodeIntoArray( $content );
$content = '';
// We need to wrap the line of code twice in order to let out `white-space: pre` CSS setting to be respected
When adding a Code block, I'm seeing a warning in the error log:
It should avoid calling
splitCodeIntoArray()if$contentis empty: