]> birchwood-abbey.net Git - mit-scheme.git/commitdiff
Fix some problems that caused invalid XML with HTML5.
authorChris Hanson <org/chris-hanson/cph>
Mon, 15 Jun 2020 06:31:22 +0000 (23:31 -0700)
committerChris Hanson <org/chris-hanson/cph>
Mon, 15 Jun 2020 06:31:22 +0000 (23:31 -0700)
src/ssp/xhtml-expander.scm
src/xml/xhtml.scm
src/xml/xml-output.scm

index f0f524c5ca395d1cdc59580e3ecc57a4cd14cb19..efeb23d99684a0d32a19fa0f21e1ff41d588cef5 100644 (file)
@@ -36,12 +36,6 @@ USA.
   (let ((document
         (read/expand-xml-file pathname
                               (make-expansion-environment pathname))))
-    (if (not (xml-document-dtd document))
-       (begin
-         (set-xml-document-dtd! document html-1.0-dtd)
-         (set-xml-document-misc-2! document
-                                   (cons "\n"
-                                         (xml-document-misc-2 document)))))
     (let ((root (xml-document-root document)))
       (if (not (find-xml-attr 'xmlns root))
          (set-xml-element-attributes!
index 23e5d35951f103ad687c0a9012e1fbf70f10f2df..e0579d718fd5f01fe175ff218a939627b584e23a 100644 (file)
@@ -90,9 +90,7 @@ USA.
 
 (define (html-dtd? object)
   (and (xml-dtd? object)
-       (eq? (xml-dtd-root object) 'html)
-       (html-external-id? (xml-dtd-external object))
-       (null? (xml-dtd-internal object))))
+       (eq? (xml-dtd-root object) 'html)))
 \f
 (define (html-1.0-document attrs . items)
   (%make-document html-1.0-dtd attrs items))
index 8e0a18f264c08790dd496d899f0c551a10351e8a..53c73a6716574157a70c8f6e78e42669da9766bc 100644 (file)
@@ -380,7 +380,9 @@ USA.
   (lambda (string ctx)
     (write-escaped-string string
                          '((#\< . "&lt;")
-                           (#\& . "&amp;"))
+                           (#\> . "&gt;")
+                           (#\& . "&amp;")
+                           (#\' . "&apos;"))
                          ctx)))
 
 (define-predicate-dispatch-handler %write-xml (list xml-entity-ref? ctx?)