Fixing xml snip bug
svn: r14087
This commit is contained in:
parent
acb18e6989
commit
04cdd975e9
|
@ -52,7 +52,7 @@
|
|||
(lambda ()
|
||||
(let* ([source-name (get-source-name editor)]
|
||||
[port (open-input-text-editor editor 0 'end (xml-snip-filter editor) source-name)]
|
||||
[xml (read-xml port)]
|
||||
[xml (parameterize ([permissive? #t]) (read-xml port))]
|
||||
[xexpr (parameterize ([permissive? #t]) (xml->xexpr (document-element xml)))]
|
||||
[clean-xexpr (if eliminate-whitespace-in-empty-tags?
|
||||
(eliminate-whitespace-in-empty-tags xexpr)
|
||||
|
|
3884
collects/tests/xml/xml-snip-bug.ss
Normal file
3884
collects/tests/xml/xml-snip-bug.ss
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -111,7 +111,7 @@
|
|||
(struct (attribute source) ([start location/c]
|
||||
[stop location/c]
|
||||
[name symbol?]
|
||||
[value string?]))
|
||||
[value (or/c string? permissive/c)]))
|
||||
[permissive? (parameter/c boolean?)]
|
||||
[permissive/c contract?]
|
||||
[content/c contract?]
|
||||
|
|
|
@ -129,7 +129,8 @@
|
|||
;; True if the list is a list of String,Symbol pairs.
|
||||
(define (attribute-symbol-string? attr true false)
|
||||
(if (symbol? (car attr))
|
||||
(if (string? (cadr attr))
|
||||
(if (or (string? (cadr attr))
|
||||
(permissive?))
|
||||
(true)
|
||||
(false (make-exn:invalid-xexpr
|
||||
(format "Expected a string, given ~a" (cadr attr))
|
||||
|
|
|
@ -96,7 +96,7 @@ Represents a document.}
|
|||
[content (listof content/c)])]{
|
||||
Represents an element.}
|
||||
|
||||
@defstruct[(attribute source) ([name symbol?] [value string?])]{
|
||||
@defstruct[(attribute source) ([name symbol?] [value (or/c string? permissive/c)])]{
|
||||
|
||||
Represents an attribute within an element.}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user