chore: fix update to 0.4.40 with absolute links via site-url

This commit is contained in:
Jesús Pérez 2024-10-01 23:54:08 +01:00
parent e1235853e3
commit 7ad069e632
No known key found for this signature in database

View File

@ -53,8 +53,12 @@ impl HtmlHandlebars {
ctx.data
.insert("git_repository_edit_url".to_owned(), json!(edit_url));
}
let content = utils::render_markdown(&ch.content, ctx.html_config.smart_punctuation());
let content = if let Some(site_url) = &ctx.html_config.site_url {
let ch = ch.content.clone().replace("](./",&format!("]({}",site_url));
utils::render_markdown(&ch, ctx.html_config.smart_punctuation())
} else {
utils::render_markdown(&ch.content, ctx.html_config.smart_punctuation())
};
let fixed_content = utils::render_markdown_with_path(
&ch.content,