mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-19 22:27:59 +01:00
camoifier in markdown
This commit is contained in:
parent
6aa9baefd2
commit
670242bc13
3 changed files with 7 additions and 14 deletions
6
native/philomena/Cargo.lock
generated
6
native/philomena/Cargo.lock
generated
|
@ -149,7 +149,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "comrak"
|
||||
version = "0.12.1"
|
||||
source = "git+https://github.com/philomena-dev/comrak?branch=main#94941ad6f41fa308383601e5b098c643e3bf80e2"
|
||||
source = "git+https://github.com/philomena-dev/comrak?branch=main#a4da46ece62bc99a82cfffb37fa7798d1b1da132"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"entities",
|
||||
|
@ -197,9 +197,9 @@ checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
|
|||
|
||||
[[package]]
|
||||
name = "flate2"
|
||||
version = "1.0.21"
|
||||
version = "1.0.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "80edafed416a46fb378521624fab1cfa2eb514784fd8921adbe8a8d8321da811"
|
||||
checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"crc32fast",
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
let
|
||||
pkgs = import <nixos> {};
|
||||
in pkgs.mkShell {
|
||||
buildInputs = [
|
||||
pkgs.cargo
|
||||
pkgs.rustc
|
||||
pkgs.rustfmt
|
||||
pkgs.clippy
|
||||
pkgs.rust-analyzer
|
||||
];
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
use comrak::ComrakOptions;
|
||||
use crate::camo;
|
||||
|
||||
fn common_options() -> ComrakOptions {
|
||||
let mut options = ComrakOptions::default();
|
||||
|
@ -11,6 +12,9 @@ fn common_options() -> ComrakOptions {
|
|||
options.parse.smart = true;
|
||||
options.render.hardbreaks = true;
|
||||
options.render.github_pre_lang = true;
|
||||
|
||||
options.extension.camoifier = Some(|s| camo::image_url(s).unwrap_or_else(|| String::from("")));
|
||||
|
||||
options
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue