Skip to content

Commit

Permalink
Merge pull request #163 from Automattic/fix/output-wrapper
Browse files Browse the repository at this point in the history
Remove <code> wrapper
  • Loading branch information
yscik committed Sep 17, 2020
2 parents 527695d + dc433ae commit f3d76f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { escape } from './utils';

export default function save( { attributes } ) {
return (
<pre>
<code>{ escape( attributes.content ) }</code>
</pre>
<pre>{ escape( attributes.content ) }</pre>
);
}
2 changes: 1 addition & 1 deletion syntaxhighlighter.php
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ public function render_block( $attributes, $content ) {
}
}

$code = preg_replace( '#<pre [^>]+><code>([^<]+)?</code></pre>#', '$1', $content );
$code = preg_replace( '#<pre [^>]+>([^<]+)?</pre>#', '$1', $content );

// Undo escaping done by WordPress
$code = str_replace( '&lt;', '<', $code );
Expand Down

0 comments on commit f3d76f1

Please sign in to comment.