Allow tags from paste plugin
Basic usage
This plugin allows you to filter tags allowed when an user paste some code into the editor.
Read allow tags from paste plugin documentationTry to paste something!
Only `h2`, `p` `strong` and `br` tags are allowed! All other tags will be removed.
Some text to copy to test
This table will be not pasted:
h4 must be kept | but not | this table |
Second line | will be | striped out too |
The code
$('#editor')
.trumbowyg({
btns: [
'viewHTML',
'h4'
],
plugins: {
allowTagsFromPaste: {
allowedTags: ['h4', 'p', 'br']
}
}
});
Setup
In head tag
At the end of body
<!-- Import jQuery -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.3.1.min.js"><\/script>')</script>