Froala config to keep i tags
by RomainMazB
HTML
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://editor-latest.s3.amazonaws.com/js/third_party/font_awesome.min.js"></script>
<script src="https://editor-latest.s3.amazonaws.com/v3/js/froala_editor.pkgd.min.js"></script>
<link rel="stylesheet" href="https://editor-latest.s3.amazonaws.com/v3/css/froala_editor.pkgd.min.css">
<link rel="stylesheet" href="https://editor-latest.s3.amazonaws.com/v3/css/froala_style.min.css">
<div id="froala-editor">
<script>console.log('debug')</script> <!-- Script will be removed -->
<style>.myClass { margin:left }</style> <!-- Style will be removed -->
<i class="right triangle icon"></i> <!-- I will live! -->
<textarea></textarea> <!-- Textarea will live! -->
<p>
Here the i tag stays alive because added to the default htmlAllowedEmptyTags option's default list.
</p>
</div>
JavaScript
new FroalaEditor(
'div#froala-editor',
{
'htmlAllowedEmptyTags': ['textarea', 'a', 'iframe', 'object', 'video', 'style', 'script', '.fa', '.fr-emoticon', '.fr-inner', 'path', 'line', 'hr', 'i'],
'toolbarButtons': {
'moreMisc': {
'buttons': ['html']
}
}
}
)