Skip to content

Commit

Permalink
Use brands type as fallback for older books
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Howell <[email protected]>
  • Loading branch information
uncenter and notriddle authored Nov 21, 2024
1 parent 2ca9f04 commit 26a2d3a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/renderer/html_handlebars/hbs_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ fn convert_fontawesome(html: &str) -> String {

if icon.is_empty() {
text.to_owned()
} else if let Ok(svg) = fa::svg(type_, &icon) {
} else if let Ok(svg) = fa::svg(type_, &icon).or_else(|| fa::svg(fa::Type::Brands, &icon)) {
format!(
r#"<span{before}class="fa-svg{other_classes}"{after}>{svg}</span>"#,
before = before,
Expand Down
1 change: 1 addition & 0 deletions src/renderer/html_handlebars/helpers/fontawesome.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub fn fa_helper(
}
out.write(
fa::svg(type_, name)
.or_else(|| fa::svg(fa::Type::Brands, name))
.map_err(|_| RenderErrorReason::Other(format!("Missing font {}", name)))?,
)?;
out.write("</span>")?;
Expand Down

0 comments on commit 26a2d3a

Please sign in to comment.