Runnable examples and documentation for bobzhang/html_parser.
moon run --target native examples/cmd/htmlfmt -- "<article><p>Hello <b>MoonBit</b></p></article>"<article>
<p>Hello <b>MoonBit</b></p>
</article>moon run --target native examples/cmd/htmlfmt -- --compact "<p class='intro'>Hello <b>MoonBit</b></p>"///|
test "examples readme formats a fragment" {
assert_eq(
@html_parser_examples.pretty_fragment(
"<article><p>Hello <b>MoonBit</b></p></article>",
),
"<article>\n <p>Hello <b>MoonBit</b></p>\n</article>",
)
assert_eq(
@html_parser_examples.compact_fragment(
"<p class='intro'>Hello <b>MoonBit</b></p>",
),
"<p class=\"intro\">Hello <b>MoonBit</b></p>",
)
}///|
test "examples readme runs htmlfmt" {
let result = @html_parser_examples.run_htmlfmt([
"--compact", "<p class='intro'>Hello <b>MoonBit</b></p>",
])
assert_eq(result.exit_code, 0)
assert_eq(result.stdout, "<p class=\"intro\">Hello <b>MoonBit</b></p>")
}#deprecated("implicit derived-impl promotion; call the trait method directly")
fn HtmlFmtResult::equal(HtmlFmtResult, HtmlFmtResult) -> Bool#deprecated("implicit derived-impl promotion; call the trait method directly")
fn HtmlFmtResult::not_equal(x : HtmlFmtResult, y : HtmlFmtResult) -> Bool#deprecated("implicit derived-impl promotion; call the trait method directly")
fn HtmlFmtResult::to_repr(HtmlFmtResult) -> Reprfn compact_fragment(input : String) -> String raisefn pretty_fragment(input : String, indent_size? : Int) -> String raiseInstall
Download zipRunnable examples and documentation for bobzhang/html_parser.