]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix an XMode bug exposed in the pastebin
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sun, 29 Mar 2009 03:13:58 +0000 (22:13 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sun, 29 Mar 2009 03:13:58 +0000 (22:13 -0500)
basis/xmode/code2html/code2html-tests.factor
basis/xmode/marker/marker.factor

index 241ab7ff75f0b466fc9e640571bbb4761ee52589..a35e6a2194c1229586de1dcacaad917cf3c9b686 100644 (file)
@@ -18,4 +18,8 @@ kernel io.streams.string xml.writer ;
     <" int x = "hi";
 /* a comment */ "> <string-reader> htmlize-stream
     write-xml
+] unit-test
+
+[ "<span class=\"MARKUP\">: foo</span> <span class=\"MARKUP\">;</span>" ] [
+    { ": foo ;" } "factor" htmlize-lines xml>string
 ] unit-test
\ No newline at end of file
index f584756f33c68f41323d4a4641ef578d84eb317b..98b4f91f86541ca0411f170edb40a33afc8f53b0 100755 (executable)
@@ -84,7 +84,7 @@ M: string-matcher text-matches?
     ] keep string>> length and ;
 
 M: regexp text-matches?
-    [ >string ] dip re-contains? ;
+    [ >string ] dip first-match to>> ;
 
 : rule-start-matches? ( rule -- match-count/f )
     dup start>> tuck swap can-match-here? [