/html-text-editor

This plugin is no longer maintained. Please follow this link for the latest update → https://github.com/tovic/text-editor/tree/master/text-editor/ui/h-t-m-l

Primary LanguageJavaScriptMIT LicenseMIT

HTML Text Editor Plugin

As mentioned in the title above.

This is the HTML version of the previous plugin called MTE.

Demo

html-text-editor

https://rawgit.com/tovic/html-text-editor/master/index.html

Basic Usage

Put icon fonts and CSS files in the <head>:

<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/hte.min.css" rel="stylesheet">

Create a <textarea> element in the body:

<textarea></textarea>

Put editor and HTE plugin after the <textarea> element then execute the plugin:

<script src="js/editor.min.js"></script>
<script src="js/hte.min.js"></script>
<script>
var myEditor = new HTE(document.getElementsByTagName('textarea')[0]);
</script>

Options

Just like the MTE plugin but initiated by HTE instead of MTE:

var myEditor = new HTE(elem, { ... });
myEditor.button('foo', {
    title: 'Bar',
    click: function() {
        alert('Baz!');
    }
});

Read more on the MTE Wiki Pages

Extra Options

Option Usage Example
autoEncodeHTML Automatically encode the selected HTML string inside <code> element? true