Skip to content
This repository has been archived by the owner on Dec 5, 2017. It is now read-only.

taufik-nurrohman/html-text-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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