From 1f1eb95699dc23193a1a39a9ae20694f69261366 Mon Sep 17 00:00:00 2001 From: Brian Kjersten Date: Tue, 4 Jun 2019 09:47:51 -0500 Subject: [PATCH] 5111 Clean up HTML output --- .../texttranslation/translators/GoogleTranslator.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Core/src/org/sleuthkit/autopsy/texttranslation/translators/GoogleTranslator.java b/Core/src/org/sleuthkit/autopsy/texttranslation/translators/GoogleTranslator.java index 318191e713..3c761af6e1 100644 --- a/Core/src/org/sleuthkit/autopsy/texttranslation/translators/GoogleTranslator.java +++ b/Core/src/org/sleuthkit/autopsy/texttranslation/translators/GoogleTranslator.java @@ -34,6 +34,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import org.openide.util.NbBundle.Messages; import org.openide.util.lookup.ServiceProvider; +import org.sleuthkit.autopsy.coreutils.EscapeUtil; import org.sleuthkit.autopsy.texttranslation.TextTranslator; import org.sleuthkit.autopsy.texttranslation.TranslationException; @@ -103,6 +104,10 @@ public final class GoogleTranslator implements TextTranslator { // put back the newlines translatedString = translatedString.replaceAll("
", "\n"); + + // With our current settings, Google Translate outputs HTML + // so we need to undo the escape characters. + translatedString = EscapeUtil.unEscapeHtml(translatedString); return translatedString; } catch (Throwable ex) { //Catching throwables because some of this Google Translate code throws throwables