escape newlines

This commit is contained in:
Yannik Schmidt
2020-09-10 02:50:20 +02:00
parent 1c978979f2
commit db0ab374c6

View File

@@ -76,11 +76,11 @@
{% if PGP_KEY %} {% if PGP_KEY %}
<script> <script>
function copyPGP(){ function copyPGP(){
navigator.clipboard.writeText("{{ PGP_KEY }}") navigator.clipboard.writeText("{{ PGP_KEY | replace('\n', '\\n') }}")
cur = document.getElementById("pgp").innerHTML cur = document.getElementById("pgp").innerHTML
document.getElementById("pgp").innerHTML = "Kopiert!" document.getElementById("pgp").innerHTML = "Kopiert!"
setTimeout(() => { setTimeout(() => {
document.getElementById("pgp").innerHTML = "PGP Key" }, 2000); document.getElementById("pgp").innerHTML = "PGP Key" }, 500);
} }
</script> </script>
<style> <style>