Skip to content

Commit

Permalink
fix: resolve logic conflicts due to merge
Browse files Browse the repository at this point in the history
  • Loading branch information
mhatzl committed Jan 30, 2024
1 parent bd62bf5 commit 361e036
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 31 deletions.
2 changes: 1 addition & 1 deletion core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl Unimarkup {
doc: Umi::create_um(um_content, &mut config).unwrap(),
},
_ => Unimarkup {
doc: parser::parse_unimarkup(um_content, &mut config),
doc: parser::parse_unimarkup(um_content, config),
},
}
}
Expand Down
1 change: 1 addition & 0 deletions render/src/umi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ impl Umi {
.preamble
.i18n
.lang
.clone()
.unwrap_or(locale!("en"))
.to_string()
.to_owned(),
Expand Down
68 changes: 38 additions & 30 deletions render/src/umi/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,42 +233,50 @@ impl Renderer<Umi> for UmiRenderer {
&mut self,
context: &Context,
) -> Result<Umi, crate::log_id::RenderError> {
let entry = UmiRow::new(
self.pos,
String::new(),
"Bibliography".to_string(),
String::new(),
self.depth,
"{$um.bibliography}".to_string(),
String::new(),
);
if context.bibliography.is_some() {
let entry = UmiRow::new(
self.pos,
String::new(),
"Bibliography".to_string(),
String::new(),
self.depth,
"{$um.bibliography}".to_string(),
String::new(),
);

self.pos += 1;
self.pos += 1;

self.proceed(Umi::with_um(
vec![entry],
context.get_config().clone(),
context.get_lang().to_string(),
))
self.proceed(Umi::with_um(
vec![entry],
context.get_config().clone(),
context.get_lang().to_string(),
))
} else {
Ok(Umi::default())
}
}

fn render_footnotes(&mut self, context: &Context) -> Result<Umi, crate::log_id::RenderError> {
let entry = UmiRow::new(
self.pos,
String::new(),
"Footnotes".to_string(),
String::new(),
self.depth,
"{$um.footnotes}".to_string(),
String::new(),
);
if context.footnotes.is_some() {
let entry = UmiRow::new(
self.pos,
String::new(),
"Footnotes".to_string(),
String::new(),
self.depth,
"{$um.footnotes}".to_string(),
String::new(),
);

self.pos += 1;
self.pos += 1;

self.proceed(Umi::with_um(
vec![entry],
context.get_config().clone(),
context.get_lang().to_string(),
))
self.proceed(Umi::with_um(
vec![entry],
context.get_config().clone(),
context.get_lang().to_string(),
))
} else {
Ok(Umi::default())
}
}
}

0 comments on commit 361e036

Please sign in to comment.