inc_barre.php3 inc_tidy.php 1.27 1.8 1.28 1.9

Update of /home/spip-cvs/spip/ecrire
In directory alan:/tmp/cvs-serv1657/ecrire

Modified Files:
  inc_barre.php3 inc_tidy.php
Log Message:
Corrections Tidy:
     * retour de la barre de raccourcis dans les forums en XHTML
     * attention: Tidy balance un entete <?xml quand en latin1

Index: inc_tidy.php

RCS file: /home/spip-cvs/spip/ecrire/inc_tidy.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- inc_tidy.php 19 Jul 2004 03:57:51 -0000 1.8
+++ inc_tidy.php 19 Jul 2004 04:42:41 -0000 1.9
@@ -50,7 +50,21 @@
     $letexte = substr($letexte,0,$pos)."@@SPIP_$source$num_echap@@"
       .substr($letexte,$pos+strlen($regs[0]));
   }
-
+
+/* // et les textarea
+ $regexp_echap_cadre = "/<\?((.*?))>/si";
+ $source = "php";
+
+ while (preg_match($regexp_echap_cadre, $letexte, $regs)) {
+ $num_echap++;
+
+ $les_echap[$num_echap] = $regs[0];
+
+ $pos = strpos($letexte, $regs[0]);
+ $letexte = substr($letexte,0,$pos)."@@SPIP_$source$num_echap@@"
+ .substr($letexte,$pos+strlen($regs[0]));
+ }*/
+
   return array($letexte, $les_echap);
}

@@ -74,7 +88,7 @@
     tidy_setopt('wrap', 0);
     tidy_setopt('indent-spaces', 4);
     tidy_setopt('output-xhtml', true);
- tidy_setopt('add-xml-decl', true);
+ tidy_setopt('add-xml-decl', false);
     tidy_setopt('indent', 5);
     tidy_setopt('show-body-only', false);
     tidy_setopt('quote-nbsp', false);
@@ -83,6 +97,9 @@
       tidy_clean_repair();
       $tidy = tidy_get_output();
       $tidy = echappe_retour($tidy, $les_echap, "xhtml");
+ // En Latin1, tidy ajoute une declaration XML (malgre add-xml-decl a false)
+ // il faut le supprimer pour eviter interpretation PHP provoquant une erreur
+ $tidy = ereg_replace ("\<\?xml([^\>]*)\>", "", $tidy);
     return $tidy;
   }
   else if (version_tidy() == "2") {

Index: inc_barre.php3

RCS file: /home/spip-cvs/spip/ecrire/inc_barre.php3,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- inc_barre.php3 17 Jul 2004 22:10:34 -0000 1.27
+++ inc_barre.php3 19 Jul 2004 04:42:41 -0000 1.28
@@ -10,8 +10,6 @@
   global $HTTP_UA_OS, $browser_name, $browser_version, $browser_description, $browser_rev;
   global $xhtml;
   
- if ($xhtml) return false;
-
   if ($browser_name == '') verif_butineur();

   if (