I found the following snippet which we can add to functions.php . I’m adding these via a plugin.
function clear_br($content) {
return str_replace("<br>","<br clear="none">", $content);
}
add_filter('the_content','clear_br');
Note that I’ve put "<br>" tag which is what wordpress creates when you enter newline characters.
Related Posts:
- how can default_content filter tell if content will load in block editor or classic editor?
- Notion-like editing and layout with a convenient freeform collaborative editor in WordPress? [closed]
- How to Analyze Blocks and find Intersection and patterns between pages
- Block editor: content resets to the previous state in “Edit as HTML” by clicking somewhere outside of the editing window
- How can I reset/remove background colour from a block
- How to add “rel=nofollow” for links in latest version of WordPress?
- Gutenberg Group block missing Layout options
- How can I get rid of extra line space in this poetry stanza
- Allow excerpt for pages in Gutenberg?
- WordPress Gutenberg Embed Blocks Are Not Responsive
- How to query multiple post types inside Gutenberg options panel?
- Implementing Gutenberg RichText onSplit / onReplace
- Gutenberg moving core blocks between categories
- Reset data when the field is cleared
- Is there a hook or filter yet for Gutenberg Block Editor to not auto-add Noreferrer to links with a target?
- How to remove specific panels in the editor (Gutenberg) when editing a block (via right panel)?
- What is the significance of ‘root’ in getEntityRecords?
- How to Disable Gutenberg & Return to the Classic WordPress Editor Without any Plugins
- Gutenberg default value not saved in json
- Gutenberg default initial values for FocalPointPicker
- Pre-set CSS class into custom block/template
- How to check whether Gutenberg editor is installed or not [duplicate]
- How to align a single Gutenberg block button in WP 5.5.3?
- Is it possible to print the output of a Gunteberg block with no classes?
- How can you reset InnerBlock content to base template?
- Gutenberg Multiple InnerBlocks
- How can we mimic the columns block in Gutenberg to instead be a list?
- How to set Gutenberg preferences programmatically with wp.data.dispatch?
- Are gutenberg blocks ideally supposed to look the same in both back-end and front-end?
- How to output child block attributes on a parent block
- Extend the “core/link” Block Format
- Passing settings from Reusable Block to it’s children
- Gutenberg element: How to usw Rangecontrol with two values to imitate a rangeslider?
- Is there any simple way to remove Gutenberg editor H1 H5 H6 and change the label for the rest H2 H3 H4?
- Deprecated for blocks.getSaveElement
- WordPress filter post content with PHP before editing it in Gutenberg
- Pass PHP vars to gutenberg sidebar
- Suggested image dimensions Gutenberg Hook
- How Add New Button to Gutenberg Editing Toolbar
- How to force gutenberg to reload blocks after saving
- How can I programaticly open Gutenberg
- Update a block template and apply those changes to an existing post/page
- How do you manage the Gutenberg block previews in the admin area?
- Custom block save does not match due to stripped slashes from br tag and added figure tag around images
- Add a hyperlink to a group block?
- Gutenberg: How to use RangeControl in the editor itself and make it work?
- How to change Block Controls Icon in Gutenberg?
- Adding content to Page settings rather than Block settings
- Detect if a block has been deleted
- Add multiple images to a custom block
- How to use __experimentalCaptureChildToolbar
- Gutenberg – Remove add block button
- Gutenberg block – remove setting for core/file
- Gutenberg JavaScript error
- Gutenberg selecting child blocks directly from appender
- WordPress Gutenberg – Open the “Block Pattern Explorer” programmatically
- Modify src attribute on image block
- Two text color palettes are appearing in Gutenberg
- WordPress Gutenberg – Sidebar get posts list based on selected category
- Gutenberg button removed on save if its empty
- Gutenberg build error: You may need an appropriate loader to handle this file type SCSS
- Table block – Wrap table
- ResizableBox component is not selectable in block editor
- Whitelist a single SVG for use in post_content
- When to use block patterns over nested blocks?
- How to convert block to a list block in WordPress gutenberg editor?
- How to do store, retrieve and write attributes in the registerFormatType method in Guttenberg?
- How can I create more advanced layouts in Gutenberg block editor?
- How to replace the Gutenberg default block with a custom block?
- how to disable a button added by a plugin in gutenberg toolbar?
- Images are not shown in the post editor
- Updating failed message when a wp_insert_post function is hooked to save_post hook
- Get post ancestors in the Block Editor
- How to disable blocks in Gutenberg editor for specific post type
- Possible to make the link autocompleter prioritize Tags before Posts?
- How to register multiple blocks
- How to edit post meta by post ID in Gutenberg
- How do I change bullet on categories block?
- Add a class to img of core/cover block
- Hide title block on edit screen in Gutenberg
- How can I disable fontSizes of the Paragraph block inside the Quote block with theme.json?
- Categories, tags and thumbnails panels are not visible in the Block editor’s post menu
- How to translate multiple blocks within one plugin
- How to disable the Code Editor in Gutenberg?
- Enable Gutenberg Editor when editing tags
- How to position more than one item over an image in a Gutenberg WordPress block theme
- Some CSS classes missing when rendering the page with get_the_content()
- Error with RichText Component
- Rem font size is different in the frontend and block editor
- Add to Media Inserter Categories
- Get attributes from last block created
- How do I make the block editor use https by default?
- Custom Gutenberg block within column block selection and update issue
- WP Gutenberg – How to parse simple images?
- How to add button to Gutenberg Editing Toolbar in Wordress
- Restrict Block from having a Parent or Ancenstor Block
- Latest WordPress Version Changes to Block Editor Template
- Allowed blocks for core/column
- Block that displays post meta as nested block of Query Loop
- InnerBlocks adds any block and saves, but the editor doesn’t show child blocks on reload