Skip to content

Commit 8b6f9ea

Browse files
committed
add support for data url images in markdown
fixes #803
1 parent 47314d1 commit 8b6f9ea

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- New configuration options:
1313
- `markdown_allow_dangerous_html`: allow the usage of html in markdown (default: false)
1414
- `markdown_allow_dangerous_protocol`: allow the usage of custom protocols in markdown (default: false)
15+
- Allow data URLs in markdown images. This allows embedding base64 encoded images in any markdown field.
1516
- see [configuration.md](./configuration.md) for more details.
1617
- In the shell component, setting the `footer` parameter to the empty string (`''`) will now completely hide the footer, instead of showing the default one
1718

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ async-trait = "0.1.61"
4848
async-recursion = "1.0.0"
4949
include_dir = "0.7.2"
5050
config = { version = "0.15.4", features = ["json"] }
51-
markdown = { version = "1.0.0-alpha.22", features = ["log"] }
51+
markdown = { version = "1.0.0-alpha.23", features = ["log"] }
5252
password-hash = "0.5.0"
5353
argon2 = "0.5.0"
5454
actix-web-httpauth = "0.8.0"

src/template_helpers.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ impl CanHelp for MarkdownHelper {
286286
let mut options = markdown::Options::gfm();
287287
options.compile.allow_dangerous_html = self.allow_dangerous_html;
288288
options.compile.allow_dangerous_protocol = self.allow_dangerous_protocol;
289+
options.compile.allow_any_img_src = true;
289290
markdown::to_html_with_options(&as_str, &options)
290291
.map(JsonValue::String)
291292
.map_err(|e| e.to_string())

0 commit comments

Comments
 (0)