How to invoke "clear formatting" method grammatically?
AndrewEastwood opened this issue · comments
Andy Eastwood commented
I want to invoke this methods when html is being paste to remove all unnecessary style attributes and have only paragraphs and breaks. Is that possible to achieve?
Natte Sharan commented
You can use ta-paste
directive.
<text-angular ng-model="formatted_html" ta-paste="formatHtml($html)"></text-angular>
finAnd in your controller you can define formatHtml
function.
$scope.formatHtml = function(content){ return content.replace(/(style="([^"]*)")/gi, '') };