TinyMCE Playground
HTML
<script src="https://cdn.tinymce.com/4/tinymce.min.js"></script>
<body>
<textarea id="richt-text-box"></textarea>
</body>
JavaScript
var content = "<p>ate <span class='single_linebreak' style='background-color:lightgray'>¶</span> a <span class='single_linebreak' style='background-color:lightgray'>¶</span> s <span class='single_linebreak' style='background-color:lightgray'>¶</span> d</p><p class='bs_emptyline_first'><br class='bs_emptyline_first'/></p><pre><!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN''http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'><head><title>Title of document</title></head><body>some content</body></html></pre>";
tinymce.init({
selector: '#richt-text-box',
plugins: 'template',
menubar: 'insert',
toolbar: "template",
templates: [
{ title: 'Template 1', description: 'Description of template 1', content: '<p>alma</p><p>korte</p>' },
{ title: 'Template 2', description: 'Description of template 2', content: 'development.html' }
],
height: 300
});
setTimeout( function() {
tinymce.activeEditor.setContent(content);
}, 2000);