pub struct ReflowOptions {Show 14 fields
pub line_length: usize,
pub break_on_sentences: bool,
pub preserve_breaks: bool,
pub sentence_per_line: bool,
pub semantic_line_breaks: bool,
pub abbreviations: Option<Vec<String>>,
pub length_mode: ReflowLengthMode,
pub attr_lists: bool,
pub myst_roles: bool,
pub require_sentence_capital: bool,
pub max_list_continuation_indent: Option<usize>,
pub defined_references: Option<HashSet<String>>,
pub atomic_spans: bool,
pub length_exemptions: LengthExemptions,
}Expand description
Options for reflowing text
Fields§
§line_length: usizeTarget line length
break_on_sentences: boolWhether to break on sentence boundaries when possible
preserve_breaks: boolWhether to preserve existing line breaks in paragraphs
sentence_per_line: boolWhether to enforce one sentence per line
semantic_line_breaks: boolWhether to use semantic line breaks (cascading split strategy)
abbreviations: Option<Vec<String>>Custom abbreviations for sentence detection Periods are optional - both “Dr” and “Dr.” work the same Custom abbreviations are always added to the built-in defaults
length_mode: ReflowLengthModeHow to measure string length for line-length comparisons
attr_lists: boolWhether to treat {#id .class key=“value”} as atomic (unsplittable) elements. Enabled for MkDocs and Kramdown flavors.
myst_roles: boolWhether to treat MyST inline roles ({role}`content`) as atomic
(unsplittable) elements. Enabled for the MyST flavor so the colon inside
{domain:role} is never used as a clause-break point.
require_sentence_capital: boolWhether to require uppercase after periods for sentence detection. When true (default), only “word. Capital” is a sentence boundary. When false, “word. lowercase” is also treated as a sentence boundary. Does not affect ! and ? which are always treated as sentence boundaries.
max_list_continuation_indent: Option<usize>Cap list continuation indent to this value when set. Used by mkdocs flavor where continuation is always 4 spaces regardless of checkbox markers.
defined_references: Option<HashSet<String>>Defined reference labels for the surrounding document, used to decide
whether a bare shortcut reference ([text]) is a real link (kept atomic
during reflow) or literal bracketed prose (wrapped like normal text).
None means no reference information is available: every shortcut is
treated as atomic. This is the safe default - it never splits a real
link, at the cost of also not wrapping literal bracketed prose.
Some(set) enables definition-aware behavior: a shortcut is atomic only
when its normalized label (see normalize_reference_label) is in the
set. Full and collapsed reference links and reference images are always
atomic regardless, because their ][ref] / [] syntax is an explicit
link signal that does not depend on a definition being in scope.
atomic_spans: boolWhether to hold emphasis/strong/strikethrough and code spans atomic during reflow. When true (default), these spans are treated as atomic units. When false, they can be wrapped word-by-word like normal text.
length_exemptions: LengthExemptionsWhich of the checker’s line-length exemptions reflow mirrors when it measures a line. Empty measures the markdown as written.
Trait Implementations§
Source§impl Clone for ReflowOptions
impl Clone for ReflowOptions
Source§fn clone(&self) -> ReflowOptions
fn clone(&self) -> ReflowOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more