ramanathan1504 commented on code in PR #4371:
URL: https://github.com/apache/logging-log4j2/pull/4371#discussion_r4328910967
##########
log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HtmlTextRenderer.java:
##########
@@ -16,22 +16,26 @@
*/
package org.apache.logging.log4j.core.pattern;
+import org.apache.logging.log4j.util.StringBuilders;
+
/**
- * TODO Renders an input as HTML output.
+ * Renders input text as HTML-escaped text.
*/
public final class HtmlTextRenderer implements TextRenderer {
- public HtmlTextRenderer(final String[] formats) {
- // TODO Auto-generated constructor stub
- }
+ public HtmlTextRenderer(final String[] formats) {}
@Override
public void render(final String input, final StringBuilder output, final
String styleName) {
Review Comment:
This overload is not reached from `MessagePatternConverter`, so no test
covers it. Can we add a direct test? Something like:
```java
@Test
void testHtmlTextRendererEscapesString() {
final StringBuilder sb = new StringBuilder("prefix:");
new HtmlTextRenderer(null).render("<b> & '", sb, null);
assertEquals("prefix:<b> & '", sb.toString());
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]