Not a real answer alert
This sounds like a long term bad idea. You are modifying a core functionality with something which do not inherit any of the generated markup of the original block. Any later processing of the block might make assumption about the markup based on the block name, but the assumptions might be wrong and it will be hard to pinpoint why as the block has the expected name.
Just like with widgets and shortcodes, if you are going to basically fork the block you should just create a new one. Modifying a block should be done only when all you do is modifying some small aspect of it, and maybe not even then.
(I do realize that you might be just playing around, but still a new block is much more KISS compatible considering the code you show here)
Related Posts:
- How to use wp.hooks.addAction() in React JS/Gutenberg?
- Hooking a callback into the code within a Gutenberg block
- What do the args for Gutenberg subpackage “hooks” function “doAction” mean?
- Use useSelect/useDispatch instead of withSelect/withDispatch
- How to use wp.hooks.addAction() in React JS/Gutenberg?
- useSelect second parameter
- Get terms of a taxonomy using useSelect
- Issue migrating a checkbox-type meta field to the block editor
- Trigger Javascript on Gutenberg (Block Editor) Save
- Gutenberg – remove / add blocks with custom script
- How to only enqueue block javascript on the frontend when its needed [duplicate]
- Show control conditionally in Gutenberg
- Gutenberg custom block plugin with custom image sizes
- How to get the ToggleControl Gutenberg component working for a PHP Block
- Is there a core Sortable component in Gutenberg?
- conditional layout based on if Innerblocks is not empty
- getEntityRecord without knowing the post type
- Gutenberg extend blocks add new class name
- initial open/toggle PluginDocumentSettingPanel panel in document setting block editor gutenberg
- Is there an equivalent of the PHP function sanitize_key in Gutenberg?
- When using the block.getSaveElement hook can you output different markup based on whether or not you are in the edit view or the live page view?
- How do I fire a snackbar notice in admin?
- Gutenberg Modify core taxonomy panel element via wp.hooks.addFilter
- What is “open()” in MediaUpload?
- Why is this gutenberg custom format button only available from the toolbar as a dropdown?
- Provide specific example for block variation
- How to handle Gutenberg wp.data async errors?
- Set current tab on a Gutenberg TabPanel component from outside that component
- Block editor: How to check if block editor has initialized and populated the data store?
- Load script after block is inserted
- Gutenberg block “This block appears to have been modified externally” on save
- How do I access site and block editor state data and use `useSelect()` or `withSelect()` to bind it to my components?
- Gutenberg passing block attributes to component in ES6/ESNext
- Can the index.asset.php file be used with the enqueue_block_editor_assets action?
- How can I add Block Style support to the core HTML block in Gutenberg?
- var is undefined in a Gutenberg block
- Gutenberg add extra attributes to custom format
- How to update a meta field of type array in Gutenberg
- Using wp.data.select get actual tags (not id’s) used in post
- How to remove p / br elements from gutenbergs editor
- Programatically update posts in database from one block to another using transform
- Gutenberg getMedia() in post query doesn’t return all featured images
- How to transform a legacy widget into a block
- Gutenberg: Block validation Failed Richtext undefined
- Gutenberg select categories
- Add custom HTML markup to Gutenberg RichText
- Listening change event of taxonomy term checkboxes in Gutenberg editor
- Gutenberg get core data – search
- What is the correct way to import the blocks-editor?
- Gutenberg extend blocks add new class name
- How to add classes and events to image in javascript using Gutenberg?
- Checks when fetching data from multiple REST API endpoints in Gutenberg
- Search for a keyword across post types in a Gutenberg component
- Using apiFetch for retrieving post data in Gutenberg
- Add custom classes for blocks in editor based on custom attributes
- How to load an additional script for a block in the block editor?
- is_front_page() variable not found
- How can I allow HTML in Gutenberg UI elements help text?
- what is the purpose of the namespace argument when customizing blocks?
- Trigger wp-embed via JavaScript to refresh iframe preview?
- Gutenberg getBlockIndex in save() function
- Widgets and Post/Page edit/new blank, console errors only, no server errors
- Trying to turn the Edit function into a class to be able to use React lifecycle methods
- Gutenberg richtext block vaildation failed
- UnitControl – Block has encountered an error
- Conditional save return on Gutenberg Block
- Can I alter the block editor’s paste text behavior?
- Custom Gutenberg-Block esnext pass variables
- Building a Featured Gallery component for Gutenberg
- Gutenberg dependencies in package.json
- How to read inline-CSS from Gutenberg block?
- Custom Gutenberg block: access dom element via JavaScript
- Custom Block – save.js function not saving attributes
- Gutenberg – useEffect manipulate DOM after block re-renders DOM
- Cannot read properties of undefined (reading ‘show_ui’) Error on WordPress Post Editor
- Refresh Gutenberg with JS for it show updated post
- Trigger function on Remove block or add new block in Gutenberg JavaScript
- Including dependencies using @wordpress/dependency-extraction-webpack-plugin
- Gutenberg – dynamically created element: how to set onChange?
- Client side pre-save Javascript hook on all admin pages
- Call javascript function when add_attachment hook fires
- Custom block update rendering when reused
- WordPress Gutenberg Ajax request
- WP Gutenberg – custom block with two content fields
- How do I make a savable preview like Youtube Gutenberg block?
- Gutenberg Edit Block Inspector Controls and save
- Spans in gutenberg
- iFrame onLoad in custom Gutenberg block
- Block pattern conflict with custom block
- Table block variation with header section activated
- Filtering Gutenberg Components, not Blocks
- Where to include JS library in gutenberg blocks
- How to delete child block for associated parent block
- Passing object to FormTokenField suggestions
- Is it possible to add javascript to template parts
- How to add a new attribute to core wp block editor without npm?
- How do i get an Inline style in Gutenberg Block show up in front end?
- WordPress adds and tags into HTML blocks after saving
- Gutenberg core/file add style support in js/ json
- Working with a non-React external library in a custom block