Heavy refactor and restructuring of content parser
This commit is contained in:
parent
15a9175afb
commit
984c8bcdcc
7 changed files with 171 additions and 134 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue