fixup! parser: impl link references

This commit is contained in:
Noah Hellman 2023-01-28 11:20:04 +01:00
parent 56190c4b0d
commit 726f1bc7b0

View file

@ -368,25 +368,17 @@ impl<'s> Parser<'s> {
SpanLinkType::Inline,
),
inline::Container::ReferenceLink => Container::Link(
if let Some(url) = self
.link_definitions
self.link_definitions
.get(self.inlines.src(inline.span).as_ref())
{
url.clone()
} else {
"".into()
},
.cloned()
.unwrap_or_else(|| "".into()),
LinkType::Span(SpanLinkType::Reference),
),
inline::Container::ReferenceImage => Container::Image(
if let Some(url) = self
.link_definitions
self.link_definitions
.get(self.inlines.src(inline.span).as_ref())
{
url.clone()
} else {
"".into()
},
.cloned()
.unwrap_or_else(|| "".into()),
SpanLinkType::Reference,
),
inline::Container::Autolink => todo!("{:?}", c),