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