From 184a26229aa93db5652d534c7acb366f08f8376e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Jeschke?= Date: Wed, 18 Mar 2015 11:24:58 +0100 Subject: [PATCH] Fix for issue #24, safeMode and line breaks There was a major flaw in the safeMode emitter, that somehow forgot to add the tag if it is a safe HTML element. I really have no idea how this one could be undetected for so long. --- .../java/com/github/rjeschke/txtmark/Utils.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/rjeschke/txtmark/Utils.java b/src/main/java/com/github/rjeschke/txtmark/Utils.java index 3f909be..0ab7437 100644 --- a/src/main/java/com/github/rjeschke/txtmark/Utils.java +++ b/src/main/java/com/github/rjeschke/txtmark/Utils.java @@ -682,12 +682,16 @@ class Utils if (HTML.isUnsafeHtmlElement(tag)) { out.append("<"); - if (isCloseTag) - { - out.append('/'); - } - out.append(temp); } + else + { + out.append("<"); + } + if (isCloseTag) + { + out.append('/'); + } + out.append(temp); } else {