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
- Why does my JavaScript work in the browser console but does not work in my shortcode?
- Background color of edit post page
- convert it into short code & explan how? [closed]
- Enqueue Scripts / Styles when shortcode is present
- Conditionally Loading JavaScript/CSS for Shortcodes
- What does extract( shortcode_atts( array( do?
- Adding Custom Text Patterns in the WP 4.5 Visual Editor
- How do I escape a ‘]’ in a short code?
- Pass boolean value in shortcode
- Show shortcode without executing it
- Shortcode always displaying at the top of the page
- Redirect function inside a Shortcode
- How to create a shortcode with 1 parameter (atts)
- Keep HTML format when switching from Visual to HTML editor
- how to show the syntax of a shortcode
- Custom shortcode being executed when saving page in wp-admin
- Change appearance of shortcode text inside editor
- current_shortcode() – detect currently used shortcode
- shortcodes output before content [duplicate]
- WordPress plugin shortcode not working
- How to add stylesheets only to pages with specific shortcode?
- Using get_option() in JavaScript
- Shortcode empty attribute
- How does a shortcode work?
- Shortcode outputs at the top of the_content
- the_excerpt and shortcodes
- Using wp_editor in shortcode
- Remove wpautop from shortcode content / remove whitespace in buffering
- Get current post id witout passing in shortcode
- Why are you using add_action for shortcode?
- How to get URL param to shortcode?
- How to add multiple buttons to TinyMCE?
- Check if post/page has gallery?
- wp_editor adds HTML entities to the content
- Get first video from the post (both embed and video shortcodes)
- Get shortcode name from within it’s callback function? [duplicate]
- How to display TinyMCE without wp_editor()
- Featured image shortcode
- Wordspress add into my javascripts
- Making a Shortcode [NEXT] and [PREVIOUS] to place into specific posts for post navigation
- How do I create a Shortcode that returns text if domain is .com, not .co.uk
- Using preg_replace to separate gallery from the_content?
- Remove specific shortcode from get_the_content()
- How to display the site name in a WordPress page, or post
- WordPress 4.8: Using multiple WYSIWYG-Editors with media inside of Widgets how to?
- Hide/show content starting in the middle of a paragraph
- Combining shortcode and get_template_part
- How do I use Shortcodes inside of HTML tags?
- How can I put a wp_redirect into a shortcode?
- Escaping quotes from shortcode attributes
- Run visual composer code in php page
- short code output too early
- Shortcode in shortcode: How to append variable?
- Remove wptexturize from a shortcode?
- How can i put an array as variable in shortcode_atts?
- WordPress 4.6 link edit dialog is too rudimentary
- Autoembeds don’t work with paragraphs
- Table of Contents with a shortcode
- Create custom [sourcecode] shortcode, the right way?
- TED talks shortcode not working
- Allowing shortcodes inside attributes
- What is the best way to enable nested shortcodes?
- Styling Shortcodes in Visual Editor
- Tinymce – How to hook before or after live shortcodes rendering?
- Change behavior of “Insert into Post” based on attachment metadata