As I mentioned in the title, how can I change the contents of the style attribute within a given HTML tag?
for example:
<table class="MsoTableLightShadingAccent1" border="1" cellspacing="0" cellpadding="0" style="margin-left: 45.9pt; border: none;">
I have got many html code like that. I wrote an RegEx like that in js:
str = str.replace(/(<(?:table)[^<]*)(style="[^"]*")([^>]*>)/gi,'<table style="font-size:medium;">');
this can change table tag but actually i want to delete only "margin-left". How can i do that with js?
Edit: I use summernote. When user paste a text, it triggers onPaste callback and i clean dirty tags and attributes.