How to undo selected / highlighted text when click on button with codemirror
问题 I have a simple codemirror text editor I am working on with bootstrap. I can click on my bold and code buttons OK and it wraps the selected / highlighted text corrctly. Question 1: When text is wrapped in a tag lets say <b>something</b> If I go and select / highlight it again and click same bold button how can I undo it in codemirror? Here's CodePen Full View Here's Codepen Code View Script <script type="text/javascript"> $(document).ready(function() { // tooltips on hover $('[data-toggle=\