Fix image path resolution for real

feature/epub-rendering
trivernis 4 years ago
parent 2f85961b65
commit e1891225ed

2
Cargo.lock generated

@ -1117,7 +1117,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "snekdown"
version = "0.22.3"
version = "0.22.4"
dependencies = [
"asciimath-rs 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"base64 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)",

@ -1,6 +1,6 @@
[package]
name = "snekdown"
version = "0.22.3"
version = "0.22.4"
authors = ["trivernis <trivernis@protonmail.com>"]
edition = "2018"
license-file = "LICENSE"

@ -7,7 +7,6 @@ use crate::references::configuration::keys::BIB_REF_DISPLAY;
use crate::references::templates::{GetTemplateVariables, Template, TemplateVariable};
use crate::Parser;
use std::collections::HashMap;
use std::path::PathBuf;
use std::sync::{Arc, RwLock};
pub(crate) trait ParseInline {
@ -146,9 +145,9 @@ impl ParseInline for Parser {
.get_string_until_any_or_rewind(&[URL_CLOSE], &[LB], start_index)?;
self.ctm.seek_one()?;
let url_path = PathBuf::from(url.clone());
let url_path = self.transform_path(url.clone());
if url_path.exists() {
url = self.transform_path(url).to_str().unwrap().to_string()
url = url_path.to_str().unwrap().to_string();
}
if description.len() > 0 {

Loading…
Cancel
Save