fix: editor tab key

This commit is contained in:
trisua 2025-07-20 18:29:43 -04:00
parent 59b8c8cac6
commit a33ee961fe
5 changed files with 24 additions and 11 deletions

View file

@ -1,4 +1,5 @@
#![doc = include_str!("../README.md")]
mod markdown;
mod model;
mod routes;
@ -19,12 +20,10 @@ pub(crate) type InnerState = (DataClient, Tera, String);
pub(crate) type State = Arc<RwLock<InnerState>>;
fn render_markdown(value: &Value, _: &HashMap<String, Value>) -> tera::Result<Value> {
Ok(
tetratto_shared::markdown::render_markdown(value.as_str().unwrap(), false)
.replace("\\@", "@")
.replace("%5C@", "@")
.into(),
)
Ok(markdown::render_markdown(value.as_str().unwrap())
.replace("\\@", "@")
.replace("%5C@", "@")
.into())
}
fn remove_script_tags(value: &Value, _: &HashMap<String, Value>) -> tera::Result<Value> {

3
src/markdown.rs Normal file
View file

@ -0,0 +1,3 @@
pub fn render_markdown(input: &str) -> String {
tetratto_shared::markdown::render_markdown(input, false)
}

View file

@ -175,7 +175,7 @@ struct RenderMarkdown {
}
async fn render_request(Json(req): Json<RenderMarkdown>) -> impl IntoResponse {
tetratto_shared::markdown::render_markdown(&req.content, false)
crate::markdown::render_markdown(&req.content)
}
#[derive(Deserialize)]