pub struct QuoteBlock<'src> { /* private fields */ }Expand description
A blockquote: a quote, prose excerpt, or verse, optionally attributed to a person and a source citation.
A blockquote can be written in several ways, all of which produce this block:
- A delimited block bounded by lines of four underscores (
____), optionally with a[quote,…]or[verse,…]attribute list. Aquoteblock has theCompoundcontent model (it contains other blocks); averseblock has theSimplecontent model and preserves its line breaks. - A styled paragraph introduced by a
[quote,…]or[verse,…]attribute list. This produces theSimplecontent model. - A quoted paragraph: a paragraph wrapped in double quotes and followed
by an attribution line introduced by two hyphens (
-- …). This produces aquoteblock with theSimplecontent model.
Implementations§
Source§impl<'src> QuoteBlock<'src>
impl<'src> QuoteBlock<'src>
Sourcepub fn attribution(&self) -> Option<&str>
pub fn attribution(&self) -> Option<&str>
Returns the rendered attribution (the person the content is attributed to), if any.
Sourcepub fn citetitle(&self) -> Option<&str>
pub fn citetitle(&self) -> Option<&str>
Returns the rendered citation title (the work the content is drawn from), if any.
Sourcepub fn content(&self) -> Option<&Content<'src>>
pub fn content(&self) -> Option<&Content<'src>>
Returns the simple content of this blockquote, if it has the
Simple content model.
Sourcepub fn blocks(&self) -> &[Block<'_>]
pub fn blocks(&self) -> &[Block<'_>]
Returns the nested blocks of a compound blockquote.
Unlike nested_blocks(), this also returns
the blocks of a Markdown-style blockquote, which borrow the block’s
own owned source rather than the document source and so are not
exposed through the 'src-bound trait method.
Trait Implementations§
Source§impl<'src> Clone for QuoteBlock<'src>
impl<'src> Clone for QuoteBlock<'src>
Source§fn clone(&self) -> QuoteBlock<'src>
fn clone(&self) -> QuoteBlock<'src>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QuoteBlock<'_>
impl Debug for QuoteBlock<'_>
impl<'src> Eq for QuoteBlock<'src>
Source§impl<'src> HasSpan<'src> for QuoteBlock<'src>
impl<'src> HasSpan<'src> for QuoteBlock<'src>
Source§impl<'src> IsBlock<'src> for QuoteBlock<'src>
impl<'src> IsBlock<'src> for QuoteBlock<'src>
Source§fn nested_blocks(&'src self) -> Iter<'src, Block<'src>>
fn nested_blocks(&'src self) -> Iter<'src, Block<'src>>
Returns the nested blocks of a ____-delimited quote.
Note: a Markdown-style blockquote’s nested blocks borrow the block’s
own owned source rather than the document source, so they cannot be
returned through this 'src-bound trait method and this iterator is
empty for them. Use QuoteBlock::blocks() to read the nested blocks
of any compound quote, Markdown-style or not. (Rendering and
reference resolution go through blocks() and an explicit
crate-internal resolve_references, so this gap is internal to the
crate.)
Source§fn nested_blocks_mut(&mut self) -> &mut [Block<'src>]
fn nested_blocks_mut(&mut self) -> &mut [Block<'src>]
Returns a mutable slice of the nested blocks of a ____-delimited
quote.
See the note on nested_blocks(): a
Markdown-style blockquote’s nested blocks are not reachable through
this method.
Source§fn content_model(&self) -> ContentModel
fn content_model(&self) -> ContentModel
ContentModel for this block.Source§fn raw_context(&self) -> CowStr<'src>
fn raw_context(&self) -> CowStr<'src>
Source§fn declared_style(&'src self) -> Option<&'src str>
fn declared_style(&'src self) -> Option<&'src str>
Source§fn rendered_content(&'src self) -> Option<&'src str>
fn rendered_content(&'src self) -> Option<&'src str>
Source§fn content_mut(&mut self) -> Option<&mut Content<'src>>
fn content_mut(&mut self) -> Option<&mut Content<'src>>
Source§fn title_source(&'src self) -> Option<Span<'src>>
fn title_source(&'src self) -> Option<Span<'src>>
Source§fn anchor_reftext(&'src self) -> Option<Span<'src>>
fn anchor_reftext(&'src self) -> Option<Span<'src>>
Source§fn attrlist(&'src self) -> Option<&'src Attrlist<'src>>
fn attrlist(&'src self) -> Option<&'src Attrlist<'src>>
Source§fn resolved_context(&'src self) -> CowStr<'src>
fn resolved_context(&'src self) -> CowStr<'src>
Source§fn options(&'src self) -> Vec<&'src str>
fn options(&'src self) -> Vec<&'src str>
Source§fn has_option<N: AsRef<str>>(&'src self, name: N) -> bool
fn has_option<N: AsRef<str>>(&'src self, name: N) -> bool
true if this block has the named option. Read moreSource§fn caption(&self) -> Option<&str>
fn caption(&self) -> Option<&str>
Source§fn number(&self) -> Option<usize>
fn number(&self) -> Option<usize>
Source§fn substitution_group(&'src self) -> SubstitutionGroup
fn substitution_group(&'src self) -> SubstitutionGroup
Source§impl<'src> PartialEq for QuoteBlock<'src>
impl<'src> PartialEq for QuoteBlock<'src>
Source§fn eq(&self, other: &QuoteBlock<'src>) -> bool
fn eq(&self, other: &QuoteBlock<'src>) -> bool
self and other values to be equal, and is used by ==.