I have a requirement to convert plain text to and from RTF (RichText Format) using javascript.
I am looking for a function for each conversion, and I am not looking to use a library.
Conversion from plain to RTF
The formatting styles and colours are not important, all that matters is that the plain text i converted into a valid RTF format
Conversion from RTF to plain
Again, the styles are not important. They can be completed removed. All that is required is that all text data remains (no loss of entered data)