You can check this out – wpgallery plugin, this is how they do it for the shortcode, basically parsing the shortcodes on the client-side, and replacing them back and forth as you click “Visual” or “Text”.
Unless you are building a plugin, I would advise you to refrain from using shortcodes – use plain HTML, you’ll have an easier time working with the DOM, and the article contents will be more or less portable across themes.
Related Posts:
- Remove inline linking tool
- How to Output HTML tags in do_shortcode?
- Stray closing paragraph tag when using shortcodes
- Can I strip HTML tags in the “Compare Revisions” screen?
- Shortcode perfomance solution
- How execute shortcode with javascript
- How to prevent tinymce macro from inserting nbsp;?
- Enclosing Shortcode Within Another Enclosing Shortcode Breaks Output Functionality
- ShortCode and extra
- Is it possible to ignore the first Line Break in a preformatted Div from a shortcode?
- Convert HTML Script to Shortcode [closed]
- Two different inner shortcode under shortcodes or multiple nesting of inner shortcodes
- Use shortcodes in custom metabox using wp_editor?
- How to type shortcode-like text in WordPress TinyMCE visual editor?
- Preserve shortcode content formatting
- How to add shortcode to HTML file (not showing on website)
- Media added with shortcodes not “linked” with post
- Documentation for adding a tinyMCE view for visual live preview of custom shortcode?
- Shortcode is not processed when added to option field using wp_editor
- Change syntax styling of TinyMCE HTML Text Editor
- How to prevent shortcode preview from breaking in tinymce editor?
- wp_editor in thickbox
- Placing tags on wordpress visual editor using shortcodes
- disable tags on wordpress text editor
- What is this format called (nested shortcodes)?
- Better way to display multiple plugin output on the same page?
- Returning HTML to Shortcode Block
- Shortcode not working inside div html
- the_content() not showing the content in good order (with a shortcode)
- Insert HTML in content property and render it using shortcodes
- How to completely prevent WordPress from destroying/modifying my shortcode outputs?
-   when I use ENTER for skipping line
- How to add a nested shortcode into editor?
- WP_Editor Shortcode Issue
- Shortcode templates
- Using get_option() in JavaScript
- Shortcode empty attribute
- How to display the site name in a WordPress page, or post
- How can I put a wp_redirect into a shortcode?
- Shortcode to insert
- Using audio shortcode for .mp3 URLs with a query string
- Get multiple shortcode attribute values
- Editor not displaying dynamically after clicking on the button
- Why do_shortcode is not executing the shortcode in data-* html attributes?
- Some doubts about gallery shortcode in WordPress
- has_shortcode for content added after the content
- tinyMCE duplicates previous block element when pressing return (visual editor)
- Creating a Slider Shortcode Based on Nivo Slider
- How can I make a shortcode from this code?
- Adding PHP/HTML code inside page from custom template
- WordPress auto adds p to shortcode parameters
- Why isn’t this youtube shortcode working?
- Gist shortcode is not working
- How to change page title (from a plugin) in twentytwentyone theme
- WordPress Code Standards and Working $link Parameters In Shortcode
- How to set Contact Form 7 fields default value using shortcode attribute? [closed]
- Shortcodes Keep Wrapping in
- Check if post has gallery images/media
- If you add a shortcode programmatically, but the code isn’t viewed on that request, is it still executed?
- How can I escape a section of my page which contains multiple shortcodes?
- shortcode to display post by category entered by user without plugin
- How create a Shortcode with hover and complex options
- How to change the output of gallery shortcode
- wp_list_pages shortcode jumps above previous content
- Shortcode attributes don’t appear?
- Using $this from child class inside shortcode function
- Div-Wrap with Functions.php in Childtheme using Shortcode!
- shortcode issue in the_excerpt
- Using shortcodes to communicate my page design
- How to check if a post has any one of many shortcodes?
- Use Contact Form 7 with Ajax
- Stop editor from adding “amp;” after every “&”
- Is it possible to add a shortcode’s content to a table?
- How to set a variable in a shortcode and reference it in another shortcode in the same post?
- Create special button on WP Tiny MCE Posts Editor for Shortcodes
- Putting a space between the buttons [closed]
- Dynamic number within shortcode
- WP REST API remove the WordPress shortcodes from the JSON wp/v2/posts content->rendered
- How to display html element and php string in the same line?
- Hide download option video shortcode
- WordPress Shorcode Display hierarchical taxonomy [child, parent]
- Shortcode not working in Jetpack Top Posts & Pages widget
- Restricting shortcode for users
- Bold button gets unchecked on enter click when bullet button is also selected in WP Editor
- Redirect per shortcode if user is logged in
- Shortcode, vs blocks, vs templates – what would you do for choosing or creating custom post data in editor?
- Convert WordPress shortcodes into plain html
- Attributes are not passed on nested shortcode
- How to make a shortcode with a line break in it parse correctly?
- Woocommerce Filter Main Loop by Tag [closed]
- Shortcodes: override a shortcode / change shortcode on the fly
- Access the resized images generated by `add_image_size()`
- woocommerce Product shortcode create [closed]
- A number appears inside a div called wpb_wrapper, when I use a custom shortcode
- Enclose article’s body with default shortcode
- Why is my ajax live search not working when i use a shortcode to call it?
- Shortcode with foreach
- WordPress shortcode select option not working [closed]
- How to reuse php templates as shortcodes?
- Shortcode attributes from meta query variables