How to clean an input html in grails/groovy for ckeditor?

1.1k views Asked by At

In my grails application, i use the ckeditor. I can save the content easily but when I edit the content, I can't fill the ckeditor. I receive a "unterminated string literal" due to this :

WRITTED CODE : var data = "${item.content}"
GENERATED CODE : var data = "<p> 
                  blavbl </p>"

I understand that's because the valu retruned by grails is multi line but how to manage this ?

Thanks a lot

1

There are 1 answers

0
Jonathan Lebrun On

I found the solution with grails :

I use the replaceAll groovy method to replace \r\n with nothing and it's working. I add this methods on domain object (setter and getter) and on the gsp.