aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-30 12:25:48 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-30 12:25:48 +0200
commitb0bc9ea9b5f5bf8a5c2f33b1102abf4f649e60c7 (patch)
treefd3e89d8c94aa8be4acb4aaba6d76e4d2286b5fc /src
parentcba6383758588068f696a50f0de614869f840614 (diff)
downloadmarkdown-rs-b0bc9ea9b5f5bf8a5c2f33b1102abf4f649e60c7.tar.gz
markdown-rs-b0bc9ea9b5f5bf8a5c2f33b1102abf4f649e60c7.tar.bz2
markdown-rs-b0bc9ea9b5f5bf8a5c2f33b1102abf4f649e60c7.zip
Fix to prefer resource when given
Diffstat (limited to 'src')
-rw-r--r--src/compiler.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/compiler.rs b/src/compiler.rs
index 7a11870..fbc4792 100644
--- a/src/compiler.rs
+++ b/src/compiler.rs
@@ -1047,15 +1047,15 @@ fn on_exit_media(context: &mut CompileContext) {
.map(|id| normalize_identifier(&id));
let label = media.label.unwrap();
let definition = id.and_then(|id| context.definitions.get(&id));
- let destination = if let Some(definition) = definition {
- &definition.destination
- } else {
+ let destination = if media.destination.is_some() {
&media.destination
- };
- let title = if let Some(definition) = definition {
- &definition.title
} else {
+ &definition.unwrap().destination
+ };
+ let title = if media.destination.is_some() {
&media.title
+ } else {
+ &definition.unwrap().title
};
let destination = if let Some(destination) = destination {