add: markdown emoji parsing
This commit is contained in:
parent
d9234bf656
commit
af67077ae7
8 changed files with 243 additions and 46 deletions
|
@ -5,7 +5,7 @@ mod routes;
|
|||
mod sanitize;
|
||||
|
||||
use assets::{init_dirs, write_assets};
|
||||
use tetratto_core::model::permissions::FinePermission;
|
||||
use tetratto_core::model::{permissions::FinePermission, uploads::CustomEmoji};
|
||||
pub use tetratto_core::*;
|
||||
|
||||
use axum::{Extension, Router};
|
||||
|
@ -24,7 +24,12 @@ use tokio::sync::RwLock;
|
|||
pub(crate) type State = Arc<RwLock<(DataManager, Tera, Client)>>;
|
||||
|
||||
fn render_markdown(value: &Value, _: &HashMap<String, Value>) -> tera::Result<Value> {
|
||||
Ok(tetratto_shared::markdown::render_markdown(value.as_str().unwrap()).into())
|
||||
Ok(
|
||||
CustomEmoji::replace(&tetratto_shared::markdown::render_markdown(
|
||||
value.as_str().unwrap(),
|
||||
))
|
||||
.into(),
|
||||
)
|
||||
}
|
||||
|
||||
fn color_escape(value: &Value, _: &HashMap<String, Value>) -> tera::Result<Value> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue