input leniency

pull/178/head
Matthew Butterick 6 years ago
parent ac6f6f209a
commit e6a5bbb639

@ -1 +1 @@
1531059962 1531775044

@ -55,9 +55,10 @@ You are kitty}")
(define (conjoin . fs) (define (conjoin . fs)
(λ (x) (andmap (λ (f) (f x)) fs))) (λ (x) (andmap (λ (f) (f x)) fs)))
(define/contract+provide (html->xexpr html-string) (define/contract+provide (html->xexpr . html-strings)
(string? . -> . xexpr?) (() () #:rest (listof string?) . ->* . xexpr?)
(use-html-spec #f) (use-html-spec #f)
(define html-string (string-join html-strings ""))
(define xexpr-results (define xexpr-results
; loop result will be a list with whitespace elements, so strip those out ; loop result will be a list with whitespace elements, so strip those out
(filter-not (conjoin string? whitespace?) (filter-not (conjoin string? whitespace?)
@ -81,9 +82,9 @@ You are kitty}")
(check-equal? (html->xexpr "\n") "")) (check-equal? (html->xexpr "\n") ""))
(define/contract+provide (html->pollen html-string #:white-p? [white-p? #f]) (define/contract+provide (html->pollen #:white-p? [white-p? #f] . html-strings)
((string?) (#:white-p? boolean?) . ->* . string?) (() (#:white-p? boolean?) #:rest (listof string?) . ->* . string?)
(xexpr->pollen #:white-p? white-p? (html->xexpr html-string))) (xexpr->pollen #:white-p? white-p? (apply html->xexpr html-strings)))
(define/contract+provide (url->pollen url-or-string #:white-p? [white-p? #f]) (define/contract+provide (url->pollen url-or-string #:white-p? [white-p? #f])

Loading…
Cancel
Save