Line Feed (and other escape characters) displaying as their unicode value in textarea.

Line Feed (and other escape characters) displaying as their unicode value in textarea.

tboaetboae Posts: 2Questions: 1Answers: 0

Hi, I have upgraded to Editor version v1.5.4. When I try to edit an entry with, for example, a line feed in it is is displayed as the unicode value of '&#10'. Is there a way around this? I would like it display as an actual line feed and an apostrophe as an apostrophe.

Also, is there a reason that the file 'dataTables.buttons.js' was missing from the latest release?

Thanks for your help.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    edited December 2015 Answer ✓

    Hi,

    Unfortunately this is related to the XSS protection that is used in the .NET version of Editor. It uses the Microsoft security libraries which appear to encode \n as its HTML entity. That seems overly strict to me - I'm not sure why they would have included the new line character in their encoding list.

    However, the first is to "decode" it on edit. I've committed the fix locally (and it will be int he next release), but to apply it directly yourself before the next release of Editor, what to do is find the following line of code in the Editor JS source:

    .replace(/'/g, '\'');
    

    and replace with:

                    .replace(/'/g, '\'')
                    .replace(/
/g, '\n');
    

    The other option is to disable the XSS protection, but I would suggest against that.

    Thanks for letting me know about that.

    Regards,
    Allan

  • tboaetboae Posts: 2Questions: 1Answers: 0

    Hi Allan,
    I applied that change and it works well. Great that we don't have to disable the XSS protection too.

    Thanks for your help Allan.

    Colin.

This discussion has been closed.