Runnable examples and documentation for bobzhang/html_parser.
Dependencies
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>")
}Runnable examples and documentation for bobzhang/html_parser.
Dependencies