Set the html contents to be pasted. It is used to correct and set the clipboard data in the beforePaste event.
Parameters:
Name | Type | Description |
|---|---|---|
| html | String | HTML DATA to paste into the editor |
editor.setEventListener('beforePaste', function(data) {
var html = data.clipboardData.html;
var text = data.clipboardData.text;
var data = html ? html : text;
// Process the data to be pasted.
editor.setContentsToPaste('<h1>Synap Editor</h1>' + data);
}); |