Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Notes on WYSIWYG editors
  • Loading branch information
ivirabyan committed Aug 20, 2015
1 parent 7fe8514 commit e118ec9
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Advantages over jquery.mentionsInput:
- Many issues are solved
- Input styles are copied to highlighter automatically
- Support for both textarea and input tags
- Support for WYSIWYG editors
- Support for contenteditable (and as a result support for some WYSIWYG editors)
- Hidden-input with markuped text created automatically
- Uses jQuery UI autocomplete

Expand Down Expand Up @@ -52,6 +52,20 @@ Getting value:

Don't use textarea value directly, because it contains special characters, used by plugin internally. Always use methods.

##### WYSIWYG editors
To create WYSIWYG editor on your site, usually you create `<textarea>` tag, and then your editor replaces it with editor's visual representation, including element with `contenteditable="true"` attribute. So, to make `mentionsInput` plugin work, you need to apply the plugin to element with `contenteditable="true"`. If you apply the plugin to your `<textarea>`, it'll not work.
For example:
```
<textarea id="content"></textarea>
<script>
$('#content').myEditor();
// Now your editor is initialized, find element with contenteditable.
// For particular plugin you may find a better way to get such an element,
// maybe even write your own plugin.
var elEditable = $('[contenteditable=true]');
elEditable.mentionsInput({...});
</script>
```

## Options

Expand Down

0 comments on commit e118ec9

Please sign in to comment.