HTML's s-expression representation
Dependencies
(% I want you to know since you came in my life)<!-- I want you to know since you came in my life -->(p One hundred million and two thousand years from now
(span (:style font-family: "Alegreya Sans SC", sans-serif)
爱してる) )<p>One hundred million and two thousand years from now
<span style="font-family: \"Alegreya Sans SC\", sans-serif">爱してる</span>
</p>(details (:open)
(summary every day every night)
\(I've been waiting to share my love with you\)
you give light into the darkness skies )<details open>
<summary>every day every night</summary>
(I've been waiting to share my love with you)
you give light into the darkness skies
</details>(p (~span hello)world)<p> <span>hello</span> world</p>(p (span hello) (# world))<p><span>hello</span> world</p>parse_sexp_html("(p (icon search))").map(transform).map(render_html)pub(all) enum SexpNode {
Text(String)
Comment(String)
RawHtml(String)
Element(String, HtmlAttrs, Array[SexpNode])
}render_html([
SexpNode::Element("p", HtmlAttrs({}), [
SexpNode::Text("<escaped> "),
SexpNode::RawHtml("<em>trusted</em>"),
]),
])let attrs : HtmlAttrs = HtmlAttrs({})
attrs.upsert("lang", Some("en"))
attrs.append_class("page")
render_open_tag("html", attrs)
render_html_document(attrs, head, body, Some("html"))fn is_sexp_close_paren(ch : Char) -> Boolfn is_sexp_open_paren(ch : Char) -> Boolfn is_sexp_paren(ch : Char) -> Boolfn is_sexp_text_escape_target(ch : Char) -> BoolHTML's s-expression representation
Dependencies