diff --git a/pgml-dashboard/src/utils/markdown.rs b/pgml-dashboard/src/utils/markdown.rs index aba253366..c5be4fd49 100644 --- a/pgml-dashboard/src/utils/markdown.rs +++ b/pgml-dashboard/src/utils/markdown.rs @@ -917,6 +917,7 @@ pub fn mkdocs<'a>(root: &'a AstNode<'a>, arena: &'a Arena>) -> anyho iter_nodes(root, &mut |node| { match &mut node.data.borrow_mut().value { + // Strip .md extensions that gitbook includes in page link urls &mut NodeValue::Link(ref mut link) => { let path = Path::new(link.url.as_str()); @@ -932,6 +933,21 @@ pub fn mkdocs<'a>(root: &'a AstNode<'a>, arena: &'a Arena>) -> anyho } &mut NodeValue::Text(ref mut text) => { + + // Strip .md extensions that gitbook includes in page link text + if text.ends_with(".md") { + if let Some(parent) = node.parent() { + match parent.data.borrow().value { + NodeValue::Link(ref link) => { + for _ in 0..".md".len() { + text.pop(); + } + } + _ => {} + } + } + } + if text.starts_with("=== \"") { let mut parent = { match node.parent() { 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