fixup! parser: impl link references
This commit is contained in:
parent
56190c4b0d
commit
726f1bc7b0
1 changed files with 6 additions and 14 deletions
20
src/lib.rs
20
src/lib.rs
|
@ -368,25 +368,17 @@ impl<'s> Parser<'s> {
|
||||||
SpanLinkType::Inline,
|
SpanLinkType::Inline,
|
||||||
),
|
),
|
||||||
inline::Container::ReferenceLink => Container::Link(
|
inline::Container::ReferenceLink => Container::Link(
|
||||||
if let Some(url) = self
|
self.link_definitions
|
||||||
.link_definitions
|
|
||||||
.get(self.inlines.src(inline.span).as_ref())
|
.get(self.inlines.src(inline.span).as_ref())
|
||||||
{
|
.cloned()
|
||||||
url.clone()
|
.unwrap_or_else(|| "".into()),
|
||||||
} else {
|
|
||||||
"".into()
|
|
||||||
},
|
|
||||||
LinkType::Span(SpanLinkType::Reference),
|
LinkType::Span(SpanLinkType::Reference),
|
||||||
),
|
),
|
||||||
inline::Container::ReferenceImage => Container::Image(
|
inline::Container::ReferenceImage => Container::Image(
|
||||||
if let Some(url) = self
|
self.link_definitions
|
||||||
.link_definitions
|
|
||||||
.get(self.inlines.src(inline.span).as_ref())
|
.get(self.inlines.src(inline.span).as_ref())
|
||||||
{
|
.cloned()
|
||||||
url.clone()
|
.unwrap_or_else(|| "".into()),
|
||||||
} else {
|
|
||||||
"".into()
|
|
||||||
},
|
|
||||||
SpanLinkType::Reference,
|
SpanLinkType::Reference,
|
||||||
),
|
),
|
||||||
inline::Container::Autolink => todo!("{:?}", c),
|
inline::Container::Autolink => todo!("{:?}", c),
|
||||||
|
|
Loading…
Reference in a new issue