London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
Hi Linus,
Took a bit of trial and error, but the following works for me:
var formats = new
{
removeformat = new object[]
{
new
{
selector =
"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,h1,h2,h3,h4,h5,h6",
remove = "all", split = true, expand = "false", block_expand = true, deep = true
}
}
};
config.Default().AddSetting("formats", formats).AppendToolbar("removeformat");
My client wants "everything" (for instance h1, h2,h3 etc.) to be unformatted when clicking on "Clear formatting" in TinyMCE (v. 2.6.5).
i'm trying to do like this:
var removeformats = @"{
formats: {
removeformat: [
{
selector: 'b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,h1,h2,h3,h4,h5,h6',
remove: 'all',
split: true,
block_expand: true,
expand: false,
deep: true
},
{ selector: 'span', attributes: ['style', 'class'], remove: 'empty', split: true, expand: false, deep: true },
{ selector: '*', attributes: ['style', 'class'], split: false, expand: false, deep: true }
]
}
}";
config.Default().RawSettings(removeformats);
But nothing changes. "Clear formatting" is still functioning as "default".
I have succeded with simpler things like var pasteOptions = "{paste_as_text: false}" ;
So i thought this would work too...
/Linus