diff --git a/extra/html/entities/entities-docs.factor b/extra/html/entities/entities-docs.factor index 2b22ce758d..49db0a0abb 100644 --- a/extra/html/entities/entities-docs.factor +++ b/extra/html/entities/entities-docs.factor @@ -3,8 +3,18 @@ IN: html.entities HELP: html-escape { $values { "str" string } { "newstr" string } } -{ $description "Replaces special characters " { $snippet "&" } ", " { $snippet "<" } ", " { $snippet ">" } ", " { $snippet "\"" } ", and " { $snippet "'" } " to HTML-safe sequences." } ; +{ $description "Replaces special characters " { $snippet "&" } ", " { $snippet "<" } ", " { $snippet ">" } ", " { $snippet "\"" } ", and " { $snippet "'" } " to HTML-safe sequences." } +{ $examples + { $example "USING: html.entities prettyprint ;" + "\"\" html-escape ." + "\"<foo>\"" } +} ; HELP: html-unescape { $values { "str" string } { "newstr" string } } -{ $description "Convert all named and numeric character references (e.g. " { $snippet ">" } ", " { $snippet ">" } ", " { $snippet ">" } ") in the string " { $snippet "str" } " to the corresponding unicode characters using the rules defined by the HTML5 standard." } ; +{ $description "Convert all named and numeric character references (e.g. " { $snippet ">" } ", " { $snippet ">" } ", " { $snippet ">" } ") in the string " { $snippet "str" } " to the corresponding unicode characters using the rules defined by the HTML5 standard." } +{ $examples + { $example "USING: html.entities prettyprint ;" + "\"x < 2 && y > 5\" html-unescape ." + "\"x < 2 && y > 5\"" } +} ;