I want to strip all HTML tags except the <a> tag from redactor. I found this handy API call called stripTags but I don't know how to use it with my current code. Any ideas?
API
var html = this.clean.stripTags(html, '<a>');
JS
$(function()
{
$('.text-editor-strip').redactor();
});
Attempt
If the stripTag is anywhere in the function then it stops Redactor from initialising as below.
$(function()
{
var html = this.clean.stripTags(html, '<a>');
$('.text-editor-strip').redactor();
});
There is a
paragraphizesetting you can turn off to eliminate the<p>tags. You can enable it when you initialize redactor:This will use
<br/>tags in place of paragraphs tags.Here's a demo.