]> gitweb.factorcode.org Git - factor.git/blob - basis/xml/entities/html/html.factor
Switch to https urls
[factor.git] / basis / xml / entities / html / html.factor
1 ! Copyright (C) 2009 Daniel Ehrenberg.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: accessors assocs kernel namespaces sequences xml
4 xml.entities ;
5 IN: xml.entities.html
6
7 SYMBOL: html-entities
8
9 : read-entities-file ( file -- table )
10     file>dtd entities>> ;
11
12 : get-html ( -- table )
13     { "lat1" "special" "symbol" } [
14         "vocab:xml/entities/html/xhtml-" ".ent" surround
15         read-entities-file
16     ] map first3 assoc-union assoc-union ;
17
18 get-html html-entities set-global
19
20 : with-html-entities ( quot -- )
21     html-entities get-global swap with-entities ; inline