diff --git a/collects/html/sgml-reader.ss b/collects/html/sgml-reader.ss index fbcf60f85a..2ba6824350 100644 --- a/collects/html/sgml-reader.ss +++ b/collects/html/sgml-reader.ss @@ -2,7 +2,8 @@ ;; warning - this was copied from the XML collection. ;; It needs to be abstracted back in. #lang scheme -(require xml) +(require xml + (prefix-in scheme: scheme)) ;; Kid-lister : (Symbol -> (U (listof Symbol) #f)) (define kid-lister/c @@ -18,6 +19,9 @@ [gen-may-contain (spec/c . -> . kid-lister/c)] [gen-read-sgml (kid-lister/c (symbol? symbol? . -> . (or/c symbol? false/c)) . -> . (() (input-port?) . ->* . (listof content/c)))]) +(define (file-position in) + (make-location 0 0 (scheme:file-position in))) + ;; Start-tag ::= (make-start-tag Location Location Symbol (listof Attribute)) (define-struct (start-tag source) (name attrs)) diff --git a/collects/tests/html/test.ss b/collects/tests/html/test.ss index 1de5e04cf7..e06d077c7f 100644 --- a/collects/tests/html/test.ss +++ b/collects/tests/html/test.ss @@ -1,6 +1,7 @@ #lang scheme (require (planet schematics/schemeunit:3) (planet schematics/schemeunit:3/text-ui) + net/url (prefix-in h: html) (prefix-in x: xml)) @@ -40,6 +41,12 @@ '()]))] (check-equal? (extract-pcdata an-html) - ' ("My title" "Hello world" "Testing" "!")))))) + ' ("My title" "Hello world" "Testing" "!")))) + + + (test-case "Eli - March 1" + (check-not-false (lambda () (h:read-html-as-xml (get-pure-port (string->url "http://list.cs.brown.edu/pipermail/plt-scheme/")))))) + + )) (run-tests html-tests)