mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 01:07:42 +00:00
Merge pull request #4835 from bhkjersten/5111-html-clean
5111 Clean up HTML output
This commit is contained in:
commit
f2386c8a88
@ -34,6 +34,7 @@ import java.util.logging.Level;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import org.openide.util.NbBundle.Messages;
|
import org.openide.util.NbBundle.Messages;
|
||||||
import org.openide.util.lookup.ServiceProvider;
|
import org.openide.util.lookup.ServiceProvider;
|
||||||
|
import org.sleuthkit.autopsy.coreutils.EscapeUtil;
|
||||||
import org.sleuthkit.autopsy.texttranslation.TextTranslator;
|
import org.sleuthkit.autopsy.texttranslation.TextTranslator;
|
||||||
import org.sleuthkit.autopsy.texttranslation.TranslationException;
|
import org.sleuthkit.autopsy.texttranslation.TranslationException;
|
||||||
|
|
||||||
@ -103,6 +104,10 @@ public final class GoogleTranslator implements TextTranslator {
|
|||||||
|
|
||||||
// put back the newlines
|
// put back the newlines
|
||||||
translatedString = translatedString.replaceAll("<br />", "\n");
|
translatedString = translatedString.replaceAll("<br />", "\n");
|
||||||
|
|
||||||
|
// With our current settings, Google Translate outputs HTML
|
||||||
|
// so we need to undo the escape characters.
|
||||||
|
translatedString = EscapeUtil.unEscapeHtml(translatedString);
|
||||||
return translatedString;
|
return translatedString;
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
//Catching throwables because some of this Google Translate code throws throwables
|
//Catching throwables because some of this Google Translate code throws throwables
|
||||||
|
Loading…
x
Reference in New Issue
Block a user