pub struct ListUtils;Expand description
Utility functions for detecting and handling lists in Markdown documents
Implementations§
Source§impl ListUtils
impl ListUtils
Sourcepub fn calculate_indentation(s: &str) -> usize
pub fn calculate_indentation(s: &str) -> usize
Calculate indentation level, counting tabs as 4 spaces per CommonMark spec
Sourcepub fn is_list_item(line: &str) -> bool
pub fn is_list_item(line: &str) -> bool
Check if a line is a list item
Sourcepub fn is_unordered_list_item(line: &str) -> bool
pub fn is_unordered_list_item(line: &str) -> bool
Check if a line is an unordered list item
Sourcepub fn is_ordered_list_item(line: &str) -> bool
pub fn is_ordered_list_item(line: &str) -> bool
Check if a line is an ordered list item
Sourcepub fn is_list_item_without_space(line: &str) -> bool
pub fn is_list_item_without_space(line: &str) -> bool
Check if a line is a list item without proper spacing after the marker
Sourcepub fn is_list_item_with_multiple_spaces(line: &str) -> bool
pub fn is_list_item_with_multiple_spaces(line: &str) -> bool
Check if a line is a list item with multiple spaces after the marker
Sourcepub fn parse_list_item(line: &str) -> Option<ListItem>
pub fn parse_list_item(line: &str) -> Option<ListItem>
Parse a line as a list item
Sourcepub fn is_list_continuation(line: &str, prev_list_item: &ListItem) -> bool
pub fn is_list_continuation(line: &str, prev_list_item: &ListItem) -> bool
Check if a line is a continuation of a list item
Sourcepub fn fix_list_item_without_space(line: &str) -> String
pub fn fix_list_item_without_space(line: &str) -> String
Fix a list item without proper spacing
Sourcepub fn fix_list_item_with_multiple_spaces(line: &str) -> String
pub fn fix_list_item_with_multiple_spaces(line: &str) -> String
Fix a list item with multiple spaces after the marker
Auto Trait Implementations§
impl Freeze for ListUtils
impl RefUnwindSafe for ListUtils
impl Send for ListUtils
impl Sync for ListUtils
impl Unpin for ListUtils
impl UnwindSafe for ListUtils
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more