diff --git a/basis/xml/errors/errors-tests.factor b/basis/xml/errors/errors-tests.factor index f28f26dfac..2ad9d53666 100644 --- a/basis/xml/errors/errors-tests.factor +++ b/basis/xml/errors/errors-tests.factor @@ -30,7 +30,7 @@ T{ bad-name f 1 3 "-" } "<-/>" xml-error-test T{ quoteless-attr f 1 12 } "/>" xml-error-test T{ quoteless-attr f 1 10 } "" xml-error-test T{ attr-w/< f 1 11 } "" xml-error-test -T{ text-w/]]> f 1 6 } "]]>" xml-error-test +T{ text-with-double-close-bracket f 1 6 } "]]>" xml-error-test T{ duplicate-attr f 1 21 T{ name { space "" } { main "this" } } V{ "a" "b" } } "" xml-error-test T{ bad-cdata f 1 3 } "" xml-error-test T{ bad-cdata f 1 7 } "" xml-error-test diff --git a/basis/xml/errors/errors.factor b/basis/xml/errors/errors.factor index a653bb734a..9a370d2805 100644 --- a/basis/xml/errors/errors.factor +++ b/basis/xml/errors/errors.factor @@ -92,7 +92,7 @@ XML-ERROR: quoteless-attr ; XML-ERROR: attr-w/< ; -XML-ERROR: text-w/]]> ; +XML-ERROR: text-with-double-close-bracket ; XML-ERROR: duplicate-attr key values ; diff --git a/basis/xml/tokenize/tokenize.factor b/basis/xml/tokenize/tokenize.factor index 900cf256bd..94690eef75 100644 --- a/basis/xml/tokenize/tokenize.factor +++ b/basis/xml/tokenize/tokenize.factor @@ -152,14 +152,15 @@ HINTS: next* { spot } ; : parse-char ( quot: ( ch -- ? ) -- seq ) 512 [ spot get (parse-char) ] keep "" like ; inline -: assure-no-]]> ( pos char -- pos' ) - "]]>" next-matching dup 2 > [ text-w/]]> ] when ; inline +: assure-no-double-bracket ( pos char -- pos' ) + "]]>" next-matching + dup 2 > [ text-with-double-close-bracket ] when ; inline :: parse-text ( -- string ) depth get zero? :> no-text 0 :> pos! |[ char | - pos char assure-no-]]> pos! + pos char assure-no-double-bracket pos! no-text [ char blank? char char: < eq? or [ char 1string t pre/post-content