-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
br tags being added instead of line breaks #790
Comments
Switching back to twentytwentythree v1.3 still gives the |
I wonder if it's related to WordPress/gutenberg#55999 |
Interesting. So the latest Gutenberg is serializing blocks with |
Correct. That's how it seems to be on my site. The plugin is treating the |
Here is some workaround plugin code you can use to fix the problem while this is sorted out: add_action(
'init',
static function () {
$block = WP_Block_Type_Registry::get_instance()->get_registered( 'core/code' );
if ( $block instanceof WP_Block_Type ) {
$old_callback = $block->render_callback;
$block->render_callback = static function ( $attributes, $content ) use ( $old_callback ) {
$content = str_replace( '<br>', "\n", $content );
return $old_callback( $attributes, $content );
};
}
},
101 // Because \Syntax_Highlighting_Code_Block\init() runs at 100.
); |
I've opened a PR to fix the issue. There's a build of the plugin you can test: #791 (comment) |
@emrikol sorry I'm just getting to this now. I tried to reproduce the issue with the JS error but I couldn't reproduce it. Could you re-check with the latest Gutenberg? Nevertheless, I see another issue with the change from |
In WordPress/gutenberg#59627 the newlines are no longer turned into |
On a recent post, I have this block in the editor:
Which renders like this when the plugin is enabled:
and like this when the plugin is disabled:
The text was updated successfully, but these errors were encountered: