I am about to add RadEditor to a page we use for creating a mail message.
The user wants to be able to generate HTML mail but also wants the Outlook-like ability to choose to send plain text mail.
My plan is to add a custom dropdown to the Editor toolbar to allow the user to choose the format and then modify the tools available in toolbar to an appropriate set dependent on the option chosen.
What I then need to do, if the user has selected Plain Text, is remove any formating that is inappropriate.
Looking at the functinality available in the radEditor demos, I can make a few calls to the Format Stripper to remove CSS, Font, Span and Word formating but I still need to remove any <a> tags.
I guess I need to leave any <p> and <br> tags 'til after the user has finished composing the message or else it's going to be just one big block of text.
Whilst I know that I could remove the <a> tags at the same time that I do the post-processing to convert the <p> and <br> tags the LFCR in the sent message, I'd prefer to do it in the editor so the user can see that tghere are no links in their message.
So, to my point. is there an example somewhere of code I can use to process the message to remove a set of tags? Or should I just discover a method of sucking out the editor's content, throw it at the HTML Agility Pack to process it and then put it back?
Or, better yet, is there an example of switching from full HTML editing to plan text already someplace?
--
Stuart (Founder member of LazyProgrammersRUs)
The user wants to be able to generate HTML mail but also wants the Outlook-like ability to choose to send plain text mail.
My plan is to add a custom dropdown to the Editor toolbar to allow the user to choose the format and then modify the tools available in toolbar to an appropriate set dependent on the option chosen.
What I then need to do, if the user has selected Plain Text, is remove any formating that is inappropriate.
Looking at the functinality available in the radEditor demos, I can make a few calls to the Format Stripper to remove CSS, Font, Span and Word formating but I still need to remove any <a> tags.
I guess I need to leave any <p> and <br> tags 'til after the user has finished composing the message or else it's going to be just one big block of text.
Whilst I know that I could remove the <a> tags at the same time that I do the post-processing to convert the <p> and <br> tags the LFCR in the sent message, I'd prefer to do it in the editor so the user can see that tghere are no links in their message.
So, to my point. is there an example somewhere of code I can use to process the message to remove a set of tags? Or should I just discover a method of sucking out the editor's content, throw it at the HTML Agility Pack to process it and then put it back?
Or, better yet, is there an example of switching from full HTML editing to plan text already someplace?
--
Stuart (Founder member of LazyProgrammersRUs)