title: How to implement a code button in a javascript wysiwyg editor
body: <p>I try to build my own WYSIWYG editor in javascript.
  Most of the buttons are quite simple (as long as document.execCommand has a commandId).</p>
  <p>But how to implement a code option like in StackOverflow editor.</p>
  <p><strong>What I tried:</strong></p>
  <pre><code>document.execCommand('formatBlock', '&lt;pre&gt;&lt;code&gt;')
  </code></pre>
  <p>Unfortunately, it is not working. What I'm doing wrong?</p>