diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/data/format/html.lux | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/stdlib/source/lux/data/format/html.lux b/stdlib/source/lux/data/format/html.lux index e33e7d4ee..0c6b1bf0e 100644 --- a/stdlib/source/lux/data/format/html.lux +++ b/stdlib/source/lux/data/format/html.lux @@ -1,25 +1,25 @@ -(;module: +(.module: [lux #- comment] (lux (data [text] text/format (coll [list "L/" Functor<List>])))) (type: #export Attributes - {#;doc "Attributes for an HTML tag."} + {#.doc "Attributes for an HTML tag."} (List [Text Text])) (type: #export HTML Text) (def: #export (text value) - {#;doc "Properly formats text to ensure no injection can happen on the HTML."} + {#.doc "Properly formats text to ensure no injection can happen on the HTML."} (-> Text HTML) (|> value - (text;replace-all "&" "&") - (text;replace-all "<" "<") - (text;replace-all ">" ">") - (text;replace-all "\"" """) - (text;replace-all "'" "'") - (text;replace-all "/" "/"))) + (text.replace-all "&" "&") + (text.replace-all "<" "<") + (text.replace-all ">" ">") + (text.replace-all "\"" """) + (text.replace-all "'" "'") + (text.replace-all "/" "/"))) (def: #export (comment content) (-> Text HTML) @@ -28,13 +28,13 @@ (def: attrs-to-text (-> Attributes Text) (|>> (L/map (function [[key val]] (format key "=" "\"" (text val) "\""))) - (text;join-with " "))) + (text.join-with " "))) (def: #export (tag name attrs children) - {#;doc "Generates the HTML for a tag."} + {#.doc "Generates the HTML for a tag."} (-> Text Attributes (List HTML) HTML) (format "<" name " " (attrs-to-text attrs) ">" - (text;join-with " " children) + (text.join-with " " children) "</" name ">")) (do-template [<name> <doc-type>] @@ -44,7 +44,7 @@ document))] [html-5 "<!DOCTYPE html>"] - [html-4.01 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">"] - [xhtml-1.0 "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"] - [xhtml-1.1 "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">"] + [html-4_01 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">"] + [xhtml-1_0 "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"] + [xhtml-1_1 "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">"] ) |