Add parser for node text with support for headers
This commit is contained in:
parent
089b507299
commit
2f247f477b
5 changed files with 69 additions and 9 deletions
|
|
@ -12,10 +12,13 @@ pub async fn node(Path(id): Path<String>) -> Response<Body> {
|
|||
|
||||
context.insert("id", &id);
|
||||
context.insert("title", &node.title);
|
||||
context.insert("text", &node.text);
|
||||
context.insert("connections", &node.connections.clone());
|
||||
context.insert("incoming", &graph.incoming.get(&id));
|
||||
|
||||
let escaped_text = tera::escape_html(&node.text);
|
||||
let out_text = crate::syntax::content::parse(&escaped_text);
|
||||
context.insert("text", &out_text);
|
||||
|
||||
let not_found = node.clone() == empty_node;
|
||||
let template_name = "node.html".to_string();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue