]> gitweb.factorcode.org Git - factor.git/commitdiff
html.entities: switch to using re-replace-with.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 18 May 2014 20:48:35 +0000 (13:48 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 18 May 2014 20:48:35 +0000 (13:48 -0700)
extra/html/entities/entities.factor

index b28f45af60fda10d6f60ff67072a089f8a7fe620..de006fcd88e596bd1ca74cf5efd059ed243d533e 100644 (file)
@@ -2341,10 +2341,5 @@ R/ &(#[0-9]+|#[xX][0-9a-fA-F]+|[^\t\n\f <&#;]{1,32});?/
 
 PRIVATE>
 
-:: html-unescape ( str -- newstr )
-    [
-        0 str re-charref [
-            drop [ [ str subseq , ] keep 1 + ] dip
-            [ str subseq replace-charref , ] keep
-        ] each-match str length str subseq ,
-    ] { } make concat ;
+: html-unescape ( str -- newstr )
+    re-charref [ rest replace-charref ] re-replace-with ;