html.parser.util: removing incomplete html escaping.

db4
John Benediktsson 2014-04-21 19:03:48 -07:00
parent 91119d87f4
commit 70fd2ebf52
1 changed files with 1 additions and 15 deletions

View File

@ -1,6 +1,6 @@
! Copyright (C) 2008 Doug Coleman. ! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: assocs kernel quoting sequences splitting ; USING: kernel quoting sequences splitting ;
IN: html.parser.utils IN: html.parser.utils
: trim1 ( seq ch -- newseq ) : trim1 ( seq ch -- newseq )
@ -15,17 +15,3 @@ IN: html.parser.utils
[ double-quote ] [ single-quote ] if ; [ double-quote ] [ single-quote ] if ;
: ?quote ( str -- newstr ) dup quoted? [ quote ] unless ; : ?quote ( str -- newstr ) dup quoted? [ quote ] unless ;
CONSTANT: html-entities H{
{ """ "\"" }
{ "&lt;" "<" }
{ "&gt;" ">" }
{ "&amp;" "&" }
{ "&#39;" "'" }
}
: html-unescape ( str -- str' )
html-entities [ replace ] assoc-each ;
: html-escape ( str -- str' )
html-entities [ swap replace ] assoc-each ;