pub struct Options {
pub gfm: bool,
pub breaks: bool,
}Expand description
The parse options. Default is this package’s defaults (gfm on,
breaks off), the same pair as Markdown.defaults in TypeScript and
Defaults in Go.
Fields§
§gfm: boolEnable the GFM extensions. Default true.
Five are implemented, and this one flag gates all of them together:
tables, strikethrough (~~x~~), task list items (- [x] foo),
autolink literals (bare www. / http:// / https:// / ftp:// /
a@b.co) and the disallowed-raw-HTML filter. Footnotes are not
implemented.
The first four are parse-time; the raw-HTML filter is applied by the
renderer, which is why html.rs reads this option too. With gfm
off the output is plain CommonMark, byte for byte.
breaks: boolRender soft line breaks as hard breaks. Default false.
Implementations§
Source§impl Options
impl Options
Sourcepub const COMMONMARK: Options
pub const COMMONMARK: Options
Plain CommonMark: every extension off. What the conformance corpus runs with.
Sourcepub fn resolve(bag: &Value) -> Options
pub fn resolve(bag: &Value) -> Options
Apply the defaults to a plugin option bag. Unknown keys are
ignored; a key present with a non-boolean value keeps the default.
This is the Rust spelling of resolveOptions / ResolveOptions.
Sourcepub fn resolve_json(bag: &Value) -> Options
pub fn resolve_json(bag: &Value) -> Options
The same resolution over a JSON bag, which is how the shared fixtures and the golden files spell a row’s options.
Trait Implementations§
impl Copy for Options
impl Eq for Options
impl StructuralPartialEq for Options
Auto Trait Implementations§
impl Forget for Options
impl Freeze for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnsafeUnpin for Options
impl UnwindSafe for Options
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.