JSFiddle - React, Tailwind, and code Playground

HTML

<textarea cols="100" rows="5" name="text" class="textarea required" id="text">select me and press H1 headline<br />
</textarea>
<br />
after this switch to source code (very first icon)<br /> and see the unwanted BR tag

<br /><br />

Not working? See video here: <a href="http://screenr.com/sxl">http://screenr.com/sxl</a>




<!-- ignore this language vars !-->

<script type="text/javascript"> var $l=[]; $l['ok'] = 'Ok'; $l['cancel'] = 'Cancel'; $l['dialog_question'] = 'Do you want to continue'; $l['alert'] = 'Alert'; $l['confirm'] = 'Confirm'; $l['prompt'] = 'Prompt'; $l['point'] = '.'; $l['colon'] = ':'; $l['question_mark'] = '?'; $l['exclamation_mark'] = '!'; </script> <script type="text/javascript"> $l['editor_bold'] = 'Bold'; $l['editor_italic'] = 'Italic'; $l['editor_underline'] = 'Underline'; $l['editor_strike_through'] = 'Strike through'; $l['editor_subscript'] = 'Subscript'; $l['editor_superscript'] = 'Superscript'; $l['editor_paragraph'] = 'Paragraph'; $l['editor_ordered_list'] = 'Ordered list'; $l['editor_unordered_list'] = 'Unordered list'; $l['editor_outdent'] = 'Outdent'; $l['editor_indent'] = 'Indent'; $l['editor_left_align'] = 'Left align'; $l['editor_center_align'] = 'Center align'; $l['editor_right_align'] = 'Right align'; $l['editor_block_justify'] = 'Block justify'; $l['editor_undo'] = 'Undo'; $l['editor_redo'] = 'Redo'; $l['editor_insert_image'] = 'Insert image'; $l['editor_insert_link'] = 'Insert link'; $l['editor_remove_link'] = 'Remove link'; $l['editor_remove_formatting'] = 'Remove formatting'; $l['editor_cut'] = 'Cut'; $l['editor_copy'] = 'Copy'; $l['editor_paste'] = 'Paste'; $l['editor_source_code'] = 'Source code'; $l['editor_wysiwyg'] = 'Wysiwyg'; $l['editor_insert_document_break'] = 'Insert document break'; $l['editor_insert_code_quote'] = 'Insert code quote'; $l['editor_insert_php_function'] = 'Insert PHP function'; $l['editor_select_text_first'] = 'You have to select the text first'; $l['editor_browser_support_no'] = 'Your browser...

CSS

div {
    overflow: hidden;
}

#editor .divider {
    background: #ccc;
    float: left;
    height: 26px;
    width: 1px;
}

#editor .control {
    background: url(http://wip.redaxscript.com/modules/editor/images/icons.png);
    cursor: pointer;
    float: left;
    height: 26px;
    width: 26px;
}

#editor .inputbar {
    padding: 10px !important;
    vertical-align: middle;
}

#editor .inputbar .text {
    margin: 0 1px 0 10px;
    width: 200px;
}

#editor .toolbar {
    background: #f7f7f7;
    border: 1px solid #d0d0d0;
    border-bottom: 0;
    margin: 0;
    width: auto;
}

.msie6 #editor .toolbar {
    display: inline-block;
}

#preview {    
    background: none;
    height: 100px;
    clear: both;
    border: 1px solid #ddd;
}

textarea {
    min-height:100px;
    border: 1px solid #ddd;
}

JavaScript

editor = function() {
    var c = [],offset = -26;
    c['bold'] = [0,$l['editor_bold'],'a','bold',1];
    c['italic'] = [1,$l['editor_italic'],'a','italic',1];
    c['underline'] = [2,$l['editor_underline'],'a','underline',1];
    c['strikethrough'] = [3,$l['editor_strike_through'],'a','strikethrough',1];
    c['superscript'] = [4,$l['editor_superscript'],'a','superscript',1];
    c['subscript'] = [5,$l['editor_subscript'],'a','subscript',1];
    c['paragraph'] = [6,$l['editor_paragraph'],'f','p'];
    c['h1'] = [7,$l['headline'],'f','h1'];
    c['h2'] = [8,$l['headline'],'f','h2'];
    c['h3'] = [9,$l['headline'],'f','h3'];
    c['h4'] = [10,$l['headline'],'f','h4'];
    c['h5'] = [11,$l['headline'],'f','h5'];
    c['h6'] = [12,$l['headline'],'f','h6'];
    c['orderedlist'] = [13,$l['editor_ordered_list'],'a','insertorderedlist',0];
    c['unorderedlist'] = [14,$l['editor_unordered_list'],'a','insertunorderedlist',0];
    c['outdent'] = [15,$l['editor_outdent'],'a','outdent',1];
    c['indent'] = [16,$l['editor_indent'],'a','indent',1];
    c['leftalign'] = [17,$l['editor_left_align'],'a','justifyleft',0];
    c['centeralign'] = [18,$l['editor_center_align'],'a','justifycenter',0];
    c['rightalign'] = [19,$l['editor_right_align'],'a','justifyright',0];
    c['blockjustify'] = [20,$l['editor_block_justify'],'a','justifyfull',0];
    c['undo'] = [21,$l['editor_undo'],'a','undo',0];
    c['redo'] = [22,$l['editor_redo'],'a','redo',0];
    c['image'] = [23,$l['editor_insert_image'],'i','insertimage',$l['editor_insert_image']+$l['colon'],''];
    c['link'] = [24,$l['editor_insert_link'],'i','createlink',$l['editor_insert_link']+$l['colon'],''];
    c['unlink'] = [25,$l['editor_remove_link'],'a','unlink',1];
    c['unformat'] = [26,$l['editor_remove_formatting'],'a','removeformat',1];
    c['cut'] = [27,$l['editor_cut'],'a','cut',1];
    c['copy'] = [28,$l['editor_copy'],'a','copy',1];
    c['paste'] = [29,$l['editor_paste'],'a','paste',0];
    c['source_code'] =...