pub enum MarkdownFencePolicy {
Disabled,
Any {
closing: MarkdownFenceClosing,
},
JsonOnly {
closing: MarkdownFenceClosing,
},
}Expand description
Controls whether and how one outer Markdown code fence is stripped.
The policy combines fence-language acceptance and closing-fence requirements so callers cannot configure contradictory combinations of independent flags.
§Examples
use qubit_json::decode::MarkdownFencePolicy;
let fence_policy = MarkdownFencePolicy::Disabled;
assert_eq!(fence_policy, MarkdownFencePolicy::Disabled);Variants§
Disabled
Leaves Markdown code fences unchanged.
Any
Strips a fence with any info-string language tag.
Fields
§
closing: MarkdownFenceClosingControls whether the opening fence needs a matching closing fence.
JsonOnly
Strips only fences with an empty, json, or jsonc first info token.
The jsonc token is accepted only as a fence label; fenced content must
still be standard JSON without comments or trailing commas.
Fields
§
closing: MarkdownFenceClosingControls whether the opening fence needs a matching closing fence.
Trait Implementations§
Source§impl Clone for MarkdownFencePolicy
impl Clone for MarkdownFencePolicy
Source§fn clone(&self) -> MarkdownFencePolicy
fn clone(&self) -> MarkdownFencePolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MarkdownFencePolicy
impl Debug for MarkdownFencePolicy
impl Eq for MarkdownFencePolicy
Source§impl Hash for MarkdownFencePolicy
impl Hash for MarkdownFencePolicy
Source§impl PartialEq for MarkdownFencePolicy
impl PartialEq for MarkdownFencePolicy
impl StructuralPartialEq for MarkdownFencePolicy
Auto Trait Implementations§
impl Freeze for MarkdownFencePolicy
impl RefUnwindSafe for MarkdownFencePolicy
impl Send for MarkdownFencePolicy
impl Sync for MarkdownFencePolicy
impl Unpin for MarkdownFencePolicy
impl UnsafeUnpin for MarkdownFencePolicy
impl UnwindSafe for MarkdownFencePolicy
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
Mutably borrows from an owned value. Read more