Created
December 12, 2018 22:12
-
-
Save joubin/134b3e8545a2014a9ecfc0afeef3333e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Map<String, Object> commentMap = (new JacksonJsonParser()).parseMap(commentStr); | |
String textComment = String.valueOf(commentMap.get("text")); | |
String htmlEscapedTextComment = HtmlUtils.htmlEscape(textComment); | |
commentMap.put("text", htmlEscapedTextComment); | |
try { | |
commentStr = (new ObjectMapper()).writeValueAsString(commentMap); | |
} catch (JsonProcessingException ignored) { | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment