From 813e72d871e2d4919b5c6e26ad788279d94ae944 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Wed, 28 Aug 2019 20:37:14 +0200 Subject: [PATCH] don't encode HTML entities in translations if they contain links --- js/privatebin.js | 9 ++++----- tpl/bootstrap.php | 2 +- tpl/page.php | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/js/privatebin.js b/js/privatebin.js index acaaf65c..0398dbdc 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -566,12 +566,11 @@ jQuery.PrivateBin = (function($, RawDeflate) { // if $element is given, apply text to element if ($element !== null) { - // set the last text node of element - let content = $element.contents(); - if (content.length > 1) { - $element.html(' ' + output).prepend(content[0]); - } else { + // avoid HTML entity encoding if translation contains link + if (output.indexOf(' - + diff --git a/tpl/page.php b/tpl/page.php index aab3124c..c6560d2c 100644 --- a/tpl/page.php +++ b/tpl/page.php @@ -49,7 +49,7 @@ if ($MARKDOWN): endif; ?> - +