Skip to content

Commit

Permalink
Fix label displaying in case 2 part linakge in scarb doc (#1803)
Browse files Browse the repository at this point in the history
  • Loading branch information
wawel37 authored Dec 3, 2024
1 parent b837de0 commit c3c8e7f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions extensions/scarb-doc/src/docs_generation/markdown/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ impl<'a> MarkdownGenerationContext<'a> {
}
_ => path_to_file_link(&resolved_item.full_path()),
},
None => link.to_string(),
None => link.path.clone().unwrap_or(link.label.clone()),
},
None => link.to_string(),
None => link.path.clone().unwrap_or(link.label.clone()),
}
}
}
Expand Down
6 changes: 1 addition & 5 deletions extensions/scarb-doc/src/docs_generation/markdown/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ pub trait MarkdownDocItem: DocItem {
DocumentationCommentToken::Content(content) => content.clone(),
DocumentationCommentToken::Link(link) => {
let file_path = context.resolve_markdown_file_path_from_link(link);
format!(
"[{}]({})",
link.path.clone().unwrap_or(link.label.clone()),
file_path
)
format!("[{}]({})", link.label.clone(), file_path)
}
})
.join("")
Expand Down

0 comments on commit c3c8e7f

Please sign in to comment.