Skip to content

Commit

Permalink
feat: Add method IsBlock::id() (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
scouten authored Jan 7, 2025
1 parent 9180f7e commit 8ecb16d
Show file tree
Hide file tree
Showing 15 changed files with 462 additions and 0 deletions.
5 changes: 5 additions & 0 deletions parser/src/blocks/is_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ pub trait IsBlock<'src>: HasSpan<'src> + Clone + Debug + Eq + PartialEq {
NO_BLOCKS.iter()
}

/// Returns the ID for this block, if present.
fn id(&'src self) -> Option<Span<'src>> {
self.attrlist().and_then(|attrlist| attrlist.id())
}

/// Returns the title for this block, if present.
fn title(&'src self) -> Option<Span<'src>>;

Expand Down
Loading

0 comments on commit 8ecb16d

Please sign in to comment.