]> matita.cs.unibo.it Git - helm.git/commitdiff
Matitaweb: fixed a bug concerning matita/html/xml escaping, which showed when
authorWilmer Ricciotti <ricciott@cs.unibo.it>
Wed, 20 Jul 2011 16:11:12 +0000 (16:11 +0000)
committerWilmer Ricciotti <ricciott@cs.unibo.it>
Wed, 20 Jul 2011 16:11:12 +0000 (16:11 +0000)
retrieving some nasty scripts from the server.

matitaB/matita/matitadaemon.ml
matitaB/matita/matitaweb.js

index 9e6b11c6f2b6189b07af5dfb007363f342214645..5d745eab776b420d377610685122b75ca3e3af13 100644 (file)
@@ -205,12 +205,12 @@ let retrieve (cgi : Netcgi1_compat.Netcgi_types.cgi_activation) =
     let filename = libdir uid ^ "/" ^ (cgi # argument_value "file") in
     prerr_endline ("reading file " ^ filename);
     let body = 
-     (* Netencoding.Html.encode ~in_enc:`Enc_utf8 ~prefer_name:false ()
+     Netencoding.Html.encode ~in_enc:`Enc_utf8 ~prefer_name:false ()
         (html_of_matita (read_file filename)) in
-     *)
-        html_of_matita (read_file filename) in
+     
+     (*   html_of_matita (read_file filename) in *)
     prerr_endline ("sending:\nBEGIN\n" ^ body ^ "\nEND");
-    let body = "<file>" ^ body ^ "</file>" in
+    let body = "<response><file>" ^ body ^ "</file></response>" in
     let baseuri, incpaths = 
       try 
         let root, baseuri, _fname, _tgt = 
index 04787ce77d3961a0919ecf9faf0e7ba24ed64ce0..fb6c0869da5b9c6afac25648187987195215b07c 100644 (file)
@@ -607,8 +607,9 @@ function retrieveFile(thefile)
        {
                if (is_defined(xml)) {  
                        locked.innerHTML = "";
-                       debug(xml.documentElement.textContent);
-                       unlocked.innerHTML = xml.documentElement.textContent;
+                       debug(xml.getElementsByTagName("file")[0].childNodes[0].nodeValue);
+                       unlocked.innerHTML = xml.getElementsByTagName("file")[0].childNodes[0].nodeValue;
+
                } else {
                        debug("file open failed");
                }