pub struct ParsedHeading<'a> {
pub line_num: usize,
pub heading: &'a HeadingInfo,
pub line_info: &'a LineInfo,
pub blockquote_depth: usize,
}Expand description
A heading recognized in the rendered Markdown document.
Unlike ValidHeading, this view includes headings inside blockquotes and
malformed ATX headings retained for diagnostics such as MD018. Consumers
can select the semantics they need without reparsing source lines.
Fields§
§line_num: usizeThe 1-indexed line number in the document.
heading: &'a HeadingInfoParsed heading metadata.
line_info: &'a LineInfoFull source-line metadata.
blockquote_depth: usizeBlockquote nesting depth, or zero for a top-level heading.
Implementations§
Source§impl ParsedHeading<'_>
impl ParsedHeading<'_>
Sourcepub fn is_blockquote(&self) -> bool
pub fn is_blockquote(&self) -> bool
Whether this heading is inside a blockquote.
Sourcepub fn text_byte_range(&self, source: &str) -> (usize, usize)
pub fn text_byte_range(&self, source: &str) -> (usize, usize)
Byte offsets (start, end) of the heading text within its source line.
Markers, closing ATX sequences, and custom-ID syntax are excluded. The range is line-relative so callers can convert it to their own position representation without rescanning Markdown syntax.
Trait Implementations§
Source§impl<'a> Clone for ParsedHeading<'a>
impl<'a> Clone for ParsedHeading<'a>
Source§fn clone(&self) -> ParsedHeading<'a>
fn clone(&self) -> ParsedHeading<'a>
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 moreimpl<'a> Copy for ParsedHeading<'a>
Auto Trait Implementations§
impl<'a> Freeze for ParsedHeading<'a>
impl<'a> RefUnwindSafe for ParsedHeading<'a>
impl<'a> Send for ParsedHeading<'a>
impl<'a> Sync for ParsedHeading<'a>
impl<'a> Unpin for ParsedHeading<'a>
impl<'a> UnsafeUnpin for ParsedHeading<'a>
impl<'a> UnwindSafe for ParsedHeading<'a>
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