Heavy refactor and restructuring of content parser

This commit is contained in:
Juno Takano 2025-12-16 03:48:42 -03:00
commit 984c8bcdcc
7 changed files with 171 additions and 134 deletions

View file

@ -1,4 +1,5 @@
use axum::{body::Body, extract::Path, http::Response};
use crate::syntax::content::parser;
use crate::{formats::populate_graph, handlers, types::Node};
@ -16,9 +17,7 @@ pub async fn node(Path(id): Path<String>) -> Response<Body> {
context.insert("incoming", &graph.incoming.get(&id));
let escaped_text = tera::escape_html(&node.text);
let out_text = crate::syntax::content::parse(&crate::syntax::content::lex(
&escaped_text,
));
let out_text = parser::read(&escaped_text);
context.insert("text", &out_text);
let not_found = node.clone() == empty_node;