Skip to content

Commit afbcd7f

Browse files
committed
Escaping JSNO-problematic characters.
1 parent 48a1e82 commit afbcd7f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/main/java/edu/uiowa/slis/graphtaglib/NodeLabel.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ public int doStartTag() throws JspException {
1717
Node theNode = (Node) findAncestorWithClass(this, Node.class);
1818
logger.trace("");
1919
try {
20-
pageContext.getOut().print(theNode.getLabel());
20+
pageContext.getOut().print(theNode.getLabel()
21+
.replace("\t", "\\t")
22+
.replace("\b", "\\b")
23+
.replace("\n", "\\n")
24+
.replace("\r", "\\r")
25+
.replace("\f", "\\f"));
2126
} catch (IOException e) {
2227
e.printStackTrace();
2328
}

0 commit comments

Comments
 (0)