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?
- Where can I find the Gutenberg block icons?
- How to filter or remove default panels in Gutenberg PrePublish Panel
- Integrate Gutenberg as a Standalone App
- Looking for all available options of Gutenberg Block
- Set fullscreen mode by default
- Gutenberg extend core blocks
- Add Button To Top Toolbar in Gutenberg
- Add Formatting Buttons to Gutenberg core/paragraph BlockControls
- All post types with getEntityRecords
- How to disallow a certain custom gutenberg block outside of an InnerBlocks block?
- Gutenberg withInstanceId. When to use it?
- Wrapping Gutenberg Blocks with a div/section/article
- How to access parent block’s attributes in nested block’s save function?
- How to add custom style to Gutenberg?
- Gutenberg Default attributes are empty
- Group block without inner wrapper
- How to stop Gutenberg injecting inline font styles
- How to get Gutenberg Gallery Block to output thumbnail images?
- Change list of allowed headline levels in Gutenberg
- srcset attribute in Gutenberg gallery blocks
- How can I add arbitrary `data-` attributes to a block’s `edit()` container?
- Gutenburg InnerBlock single child
- WordPress-gutenberg – Block validation: Expected text
- Does `viewScript` in `block.json` actually enqueue a js file?
- 404 in gutenberg autosave of a Custom Post Type with custom rest_namespace
- Notices in the Block Editor with multiple lines
- Replication of core column block produces different markup
- How to change the Default block in the block-editor away from the paragraph block?
- Create RangeControl in gutenberg Block
- Where are the layout defaults in Twenty Twenty Two coming from?
- How to Disable auto id attributes in Heading tag?
- Gutenberg: how to hide server side render output in the editor but keep it in frontend?
- How to Get a List of Formats of a Block?
- Remove a plugin from the Gutenberg sidebar
- Gutenberg how to save to post meta?
- How to get current post id in Gutenberg Block save function?
- Gutenberg: dynamic block ToggleControl error in saving
- How to limit the selection of the first level block in Gutenberg editor
- disable gutemberg welcome message
- props.setAttributes results in “Maximum update depth exceeded.”
- How can I programmatically select a Gutenberg block?
- Clipboard processing in Gutenburg
- Gutenberg: Dynamic rendering of RichText
- Block Controls not showing
- Gutenberg and FSE: How to exclude a block from full site editing
- Disable only one Gutenberg block programatically / coblock/maps not listed in blocks
- How to select block variation from BlockVariationPicker
- WordPress Full Site Editing: How can I access my posts listing page?
- Editable button with RichText for Gutenberg custom block
- How to import Reusable Blocks programatically?
- Remove formatting in rich text with Gutenbergs Block editor
- Setting font sizes in theme.json
- Is it possible to disable font sizes on sub blocks only?
- Get selected block every time a new block is selected in Gutenberg
- How do I include and iframe in a Custom Block?
- Gutenberg InnerBlocks with ACF Blocks – How to enable multiple buttons?
- How to work with multilingual sites using the full site editor and block themes?
- Trying to edit a page returns the editor encountered an unexpected error
- Block patterns: Any way to reset the pattern to whatever is in the code?
- Block variation / Variation API scope “transform”
- Is there a function to “blockify” html?
- Custom style css doesn’t work in Gutenberg preview
- Gutenberg get list of all custom image sizes
- How to set a template part area?
- Video Block does not autoplay
- Upgraded to wordpress 5.7 and now I can’t select myself as a post author
- Stop JSON code from injecting into gutenburg classic block
- Extend the “Convert to Blocks” feature to add additional functionality
- Gutenberg/WordPress – Limit number of categories
- Block editor not displaying properly
- Can the Gutenberg editor be toggled closed?
- Guenberg Block Not Saving – When additional div added
- How to open WordPress media create/edit Gallery Dialog
- WordPress custom block compatability with WPML
- Add a button to the Gutenberg editor header
- Component toggle not toggling
- Disabling gutenbeg slow down post saving
- How to solve react dom ‘removeChild’ on Node error while google translate extension is on and selecting any core block [closed]
- How to use react in frontend of dynamic blocks?
- How to use isSavingNonPostEntityChanges in the same scope correctly?
- Attempting to specify viewScript, in a custom block, results in a register_block_script_handle error
- What is the standard way to use the version of React that ships with Gutenberg on the front end?
- Restricting core block nested blocks
- Is is possible to use Templates with blockprops?
- How to add readable name and description to templates?
- Errror generated in console leading to block validation failer
- Add Custom Block Supports to Core Block
- Block validation failed – save content vs post body content
- How to propegate changes from block render_callback to other blocks using that callback?
- wordpress 6.2 is alignfull and lignwide removed?
- I can’t highlight/select text in the RichText components in my Gutenberg blocks
- Lazy load video block while keeping autoplay
- Where’s the Block Template Feature in WordPress?
- Is it possible to add custom Components in the InspectorControls to the new “Styles” Tab?