Skip to content

Commit

Permalink
Use a builder pattern for public structs, for future-proofing
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekleog committed Jan 2, 2023
1 parent af202d3 commit 71437e6
Show file tree
Hide file tree
Showing 44 changed files with 1,066 additions and 1,069 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ path = "benches/bench.rs"
harness = false

[dependencies]
derive_builder = "0.12.0"
log = "0.4"
unicode-id = { version = "0.3", features = ["no_std"] }

Expand Down
16 changes: 8 additions & 8 deletions examples/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ fn main() -> Result<(), String> {
"{:?}",
markdown::to_html_with_options(
"<div style=\"color: tomato\">\n\n# Hello, tomato!\n\n</div>",
&markdown::Options {
compile: markdown::CompileOptions {
allow_dangerous_html: true,
allow_dangerous_protocol: true,
..markdown::CompileOptions::default()
},
..markdown::Options::default()
}
&markdown::OptionsBuilder::default()
.compile(
markdown::CompileOptionsBuilder::default()
.allow_dangerous_html(true)
.allow_dangerous_protocol(true)
.build()
)
.build()
)
);

Expand Down
Loading

0 comments on commit 71437e6

Please sign in to comment.