diff --git a/pgml-dashboard/src/utils/markdown.rs b/pgml-dashboard/src/utils/markdown.rs index 949bf7b17..47869ba16 100644 --- a/pgml-dashboard/src/utils/markdown.rs +++ b/pgml-dashboard/src/utils/markdown.rs @@ -742,16 +742,24 @@ pub fn mkdocs<'a>(root: &'a AstNode<'a>, arena: &'a Arena>) -> anyho _ => "".to_string(), }; - for _ in 0..fragment.len() + 1 { + // Remove fragment and the fragment identifier #. + for _ in 0..fragment.len() + + match fragment.len() { + 0 => 0, + _ => 1, + } + { link.url.pop(); } + // Remove file path to make this a relative url. if link.url.ends_with(".md") { for _ in 0..".md".len() { link.url.pop(); } } + // Add fragment path that matches toc links. let header_id = TocLink::from_fragment(fragment).id; for c in header_id.chars() { link.url.push(c) @@ -1041,15 +1049,9 @@ pub fn mkdocs<'a>(root: &'a AstNode<'a>, arena: &'a Arena>) -> anyho info_block_close_items.push(None); parent.detach(); } else if text.contains("{% content-ref url=") { - let url = parser(text.as_ref(), r#"url=""#); - let n = arena.alloc(Node::new(RefCell::new(Ast::new(NodeValue::HtmlInline(format!( - r#"
- -
"#, - url.unwrap(), + r#"
"#, )))))); - let parent = node.parent().unwrap(); info_block_close_items.push(None); @@ -1096,14 +1098,8 @@ pub fn mkdocs<'a>(root: &'a AstNode<'a>, arena: &'a Arena>) -> anyho parent.detach(); } else if text.starts_with("{% endcontent-ref %}") { let parent = node.parent().unwrap(); - let n = arena.alloc(Node::new(RefCell::new(Ast::new(NodeValue::HtmlInline( - r#" -
-
-
- "# - .to_string(), + r#"
"#.to_string(), ))))); parent.insert_after(n); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy