1
I’m using the API Sceditor to make a text editor available on the page, but I need to fill it (set the value) with the contents of an RTF string. I did it this way, but it was already wrong in the quotation marks...
var textarea = document.getElementById('example');
sceditor.create(textarea, {
format: 'xhtml',
style: 'minified/themes/content/default.min.css'
});
And the "Expected hexadecimal Digit" error refers to what?
– user75204
Which editor are you using? It seems he is interpreting some string value as hexadecimal, this error occurs in the browser too?... Hexadecimals have a Unicod pattern as
\uXXXX
and some part of the string value must look like this pattern, for example\u82Yu
(What would cause the error, because in hexadecimal there is neither Y nor u). This occurs because ofbackslashes
which are used to escape string values.– bio
Here you go a more detailed explanation. In highlight, read the part Observing.
– bio
The string I need to insert into wysiwyg contains RTF. I entered according to the answer, but the result was the string itself, as if wysiwyg had not interpreted the RTF.
– user75204
Maybe you have to convert RTF text to HTML, like in Soen’s reply. I Googled it and there’s a Github library in javascript that can perform this conversion, although I have not tested.
– bio