Skip to content

Missing ability to add a text node to a UL/OL

For lists, from the test example:

let html_list = build_html::Container::new(ContainerType::OrderedList)
            .add_header_attr(1, "header", hashmap! {"id" => "main-header"})
            .add_image("myimage.png", "test image")
            .add_link("rust-lang.org", "Rust Home")
            .add_paragraph_attr("Sample Text", hashmap! {"class" => "red-text"})
            .add_preformatted_attr("Text", hashmap! {"class" => "code"})
            .add_text("Foo"); // something like this?

There seems to be missing a way to add a simple text node to an <li></li>

            r#"<li><h1 id="main-header">header</h1></li>"#,
            r#"<li><img src="myimage.png" alt="test image"></li>"#,
            r#"<li><a href="rust-lang.org">Rust Home</a></li>"#,
            r#"<li><p class="red-text">Sample Text</p></li>"#,
            r#"<li><pre class="code">Text</pre></li>"#
            r#"<li>Foo</li>"#

Or do we use .add_html and if so, how? (sorry, Rust newbie) Thanks!