Benutzer:PDD/replaceQuoteSigns2.js

 // ersetzt ASCII quotes durch typographische Quotes
 // (Achtung: Änderungen immer erst mit "Änderungen zeigen" überprüfen!)
 
 // Funktion von [[Benutzer:BLueFiSH.as]]
 
 // <nowiki>
 
 function replaceQuoteSigns() {
    var tbchangevalue = document.editform.wpTextbox1.value;
 
    // Sonderfälle umwandeln zum Erhalt
    tbchangevalue = tbchangevalue.replace(/\=\"/g, "§$%");
    tbchangevalue = tbchangevalue.replace(/\;\"/g, "$%&");
    tbchangevalue = tbchangevalue.replace(/\"\//g, "%&/");
    tbchangevalue = tbchangevalue.replace(/\" \//g, "% &/");
    tbchangevalue = tbchangevalue.replace(/\"\>/g, "%&>");
 
 /*
  Ausnahmenbeispiele
  <ref name="Hallo" />
  <br style="clear:both">
  "Hallo"
  Hallo ''"Hallo"'' Hallo
  Hallo "''Hallo''" Hallo
 
  {{Koordinate Artikel|40"&nbsp;N, 44"&nbsp;O}}
  {{Koordinate Artikel|40" N, 44" O}}
  {{Koordinate Artikel|40" n. Br., 13° 24' 39" ö. L.}}
  align="|
  align="right" |
  bla" align
  bla" cell
  bla" style
  px"
  bla" bgcolor
  bla"
  |
  bla"
  !
 */
 
    // spezielle Fälle für öffnende "
    tbchangevalue = tbchangevalue.replace(/ \"/g, " „");
    tbchangevalue = tbchangevalue.replace(/ \'\'\"/g, " ''„");
    tbchangevalue = tbchangevalue.replace(/\(\"/g, "(„");
    tbchangevalue = tbchangevalue.replace(/\n\"/g, "\n„");
    tbchangevalue = tbchangevalue.replace(/\n\'\'\"/g, "\n''„");
    tbchangevalue = tbchangevalue.replace(/:\"/g, ":„");
    tbchangevalue = tbchangevalue.replace(/:\'\'\"/g, ":''„");
    tbchangevalue = tbchangevalue.replace(/\|\"/g, "|„");
 
    // verbleibende " konvertieren (meistens schließende)
    tbchangevalue = tbchangevalue.replace(/\"/g, "“");
    tbchangevalue = tbchangevalue.replace(/ „ /g, " „");
    tbchangevalue = tbchangevalue.replace(/ “ /g, "“ ");
 
    // Ausnahmen zurückkorrigieren
    tbchangevalue = tbchangevalue.replace(/“ \|/g, "\" |");
    tbchangevalue = tbchangevalue.replace(/“\|/g, "\"|");
    tbchangevalue = tbchangevalue.replace(/prettytable“/g, "prettytable\"");
    tbchangevalue = tbchangevalue.replace(/right“/g, "right\"");
    tbchangevalue = tbchangevalue.replace(/left“/g, "left\"");
    tbchangevalue = tbchangevalue.replace(/center“/g, "center\"");
    tbchangevalue = tbchangevalue.replace(/px“/g, "px\"");
    tbchangevalue = tbchangevalue.replace(/“ align/g, "\" align");
    tbchangevalue = tbchangevalue.replace(/“ valign/g, "\" valign");
    tbchangevalue = tbchangevalue.replace(/“ width/g, "\" width");
    tbchangevalue = tbchangevalue.replace(/“ cell/g,  "\" cell");
    tbchangevalue = tbchangevalue.replace(/“ style/g, "\" style");
    tbchangevalue = tbchangevalue.replace(/“ bgcolor/g, "\" bgcolor");
    tbchangevalue = tbchangevalue.replace(/“ col/g, "\" col");
    tbchangevalue = tbchangevalue.replace(/“\n\|/g, "\"\n|");
    tbchangevalue = tbchangevalue.replace(/“\n\!/g, "\"\n!");
    tbchangevalue = tbchangevalue.replace(/\“ ([N|S]),/g, "\" $1,");
    tbchangevalue = tbchangevalue.replace(/\“ ([O|W])\}\}/g, "\" $1}}");
    tbchangevalue = tbchangevalue.replace(/\“\&nbsp\;([N|S]),/g, "\"&nbsp;$1,");
    tbchangevalue = tbchangevalue.replace(/\“\&nbsp\;([O|W])\}\}/g, "\"&nbsp;$1}}");
    tbchangevalue = tbchangevalue.replace(/\“ ([n|s|ö|w])\./g, "\" $1.");
    tbchangevalue = tbchangevalue.replace(/\“\&nbsp\;([n|s|ö|w])\./g, "\"&nbsp;$1.");
 
    // Sonderfälle zurückwandeln
    tbchangevalue = tbchangevalue.replace(/\§\$\%/g, "=\"");
    tbchangevalue = tbchangevalue.replace(/\$\%\&/g, ";\"");
    tbchangevalue = tbchangevalue.replace(/\%\&\//g, "\"/");
    tbchangevalue = tbchangevalue.replace(/\% \&\//g, "\" /");
    tbchangevalue = tbchangevalue.replace(/\%\&\>/g, "\">");
 
    document.editform.wpTextbox1.value = tbchangevalue;
 }
 // </nowiki>

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.