Fix indentation in files

This commit is contained in:
Gabriel Simmer 2023-08-13 18:08:47 +01:00
parent 06dffb2f57
commit 97d7462789
Signed by: arch
SSH key fingerprint: SHA256:mXaHIY3tLtudNyb+i3qRd0DeXvpqbst04OgVKVCp2R4

View file

@ -60,7 +60,7 @@ pub struct DefaultHtmlHandler;
impl HtmlHandler<Error> for DefaultHtmlHandler { impl HtmlHandler<Error> for DefaultHtmlHandler {
fn start<W: Write>(&mut self, mut w: W, element: &Element) -> IOResult<()> { fn start<W: Write>(&mut self, mut w: W, element: &Element) -> IOResult<()> {
let image_pattern = ["png", "jpeg", "jpg", "gif", "tiff", "tif", "xbm", "xpm", "pbm", "pgm", "ppm", "pnm", "svg", "webp"]; let image_pattern = ["png", "jpeg", "jpg", "gif", "tiff", "tif", "xbm", "xpm", "pbm", "pgm", "ppm", "pnm", "svg", "webp"];
match element { match element {
// container elements // container elements
Element::SpecialBlock(_) => (), Element::SpecialBlock(_) => (),
@ -126,15 +126,15 @@ impl HtmlHandler<Error> for DefaultHtmlHandler {
let link_extension = &link.path.split(".").last().unwrap(); let link_extension = &link.path.split(".").last().unwrap();
// Orgmode considers something an image both if the pattern // Orgmode considers something an image both if the pattern
// matches /and/ the description is empty. // matches /and/ the description is empty.
if image_pattern.contains(link_extension) && link.desc.is_some() { if image_pattern.contains(link_extension) && link.desc.is_some() {
write!( write!(
w, w,
"<img src=\"{}\" alt=\"{}\">", "<img src=\"{}\" alt=\"{}\">",
HtmlEscape(&link.path), HtmlEscape(&link.path),
HtmlEscape(link.desc.as_ref().unwrap_or(&link.path)), HtmlEscape(link.desc.as_ref().unwrap_or(&link.path)),
)? )?
} else { } else {
write!( write!(
w, w,
"<a href=\"{}\">{}</a>", "<a href=\"{}\">{}</a>",
HtmlEscape(&link.path), HtmlEscape(&link.path),