The json string sent by ajax with the reverse escaping of the content background of the html rich text editor

Forget it! The premise will not say!

Ajax will put html tags when submitting json data! It is also possible that all types of tags are escaped! Anyway, what I encountered here is an escape! Then anyway, I can't do it in the front end. After all, Ajax is not under my control! And the symbol to the html tag may affect the json data format!

The above is pure obscenity!

Anyway, the solution in the background is to send the transferred html string sent from the front end

First replace "&" with "&" and ajax will add a space after &!

String aa=StringEscapeUtils.unescapeHtml(postResponseVo.getPostParagraph().replaceAll("& ", "&"));

Then reverse the escape!

postResponseVo.setPostParagraph (aa);

Store at last! 

This way of mine just solved my current problem! I don't know if it can cover everything! for reference only!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326155077&siteId=291194637