]> hackdaworld.org Git - outofuni/jsutils.git/commitdiff
more umlaute and sonderzeichen
authorhackbard <hackbard@hackdaworld.org>
Sun, 15 Oct 2017 08:24:03 +0000 (10:24 +0200)
committerhackbard <hackbard@hackdaworld.org>
Sun, 15 Oct 2017 08:24:03 +0000 (10:24 +0200)
utils.js

index 0d78e8ba33ca17cb8c762e0ebdeaa7bf6a7a2a65..a63f0afafe813d7a05eaf7526f96e85f7844f046 100644 (file)
--- a/utils.js
+++ b/utils.js
@@ -34,14 +34,22 @@ function vert_align_text(trg) {
 }
 
 function html2ascii(str) {
+       str=str.replace(/\&Auml\;/g,"Ä");
+       str=str.replace(/\&Ouml\;/g,"Ö");
+       str=str.replace(/\&Uuml\;/g,"Ü");
        str=str.replace(/\&auml\;/g,"ä");
        str=str.replace(/\&ouml\;/g,"ö");
        str=str.replace(/\&uuml\;/g,"ü");
        str=str.replace(/\&szlig\;/g,"ß");
+       str=str.replace(/\&amp\;/g,"&");
        return str;
 }
 
 function ascii2html(str) {
+       str=str.replace(/&/g,"&amp;");
+       str=str.replace(/Ä/g,"&Auml;");
+       str=str.replace(/Ö/g,"&Ouml;");
+       str=str.replace(/Ü/g,"&Uuml;");
        str=str.replace(/ä/g,"&auml;");
        str=str.replace(/ö/g,"&ouml;");
        str=str.replace(/ü/g,"&uuml;");