Package win.dailypickle.report.html
Class Text
java.lang.Object
win.dailypickle.report.html.Text
Escaping, pretty-printing, and formatting helpers for report output.
Two escaping contexts exist in the report and must not be mixed up: esc(java.lang.String) for text
placed in HTML element/attribute content, and escJs(java.lang.String)/jsStr(java.lang.String) for text embedded in
JavaScript string literals inside the inline <script> block.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringmimeToLanguage(String mimeType) static StringprettyPrint(String content, String lang) Best-effort pretty-printer.
-
Method Details
-
prettyPrint
Best-effort pretty-printer. XML is formatted through a real DOM parse + identity transform, so it must be well-formed — anything the parser rejects (including any DOCTYPE, which is disallowed against XXE) comes back unchanged. JSON goes through the streaming transform, which never validates: malformed JSON is still reformatted token-by-token, not returned unchanged. Other languages pass through as-is. -
mimeToLanguage
-