Canonicalize markdown link paths (#29119)
Closes #28657 Release Notes: - Fixed markdown preview not canonicalizing file paths
This commit is contained in:
parent
f915c24279
commit
afe23cf85a
2 changed files with 3 additions and 1 deletions
|
@ -31,6 +31,7 @@ ui.workspace = true
|
||||||
util.workspace = true
|
util.workspace = true
|
||||||
workspace.workspace = true
|
workspace.workspace = true
|
||||||
workspace-hack.workspace = true
|
workspace-hack.workspace = true
|
||||||
|
fs.workspace = true
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
editor = { workspace = true, features = ["test-support"] }
|
editor = { workspace = true, features = ["test-support"] }
|
||||||
|
|
|
@ -4,6 +4,7 @@ use crate::markdown_elements::{
|
||||||
ParsedMarkdownHeading, ParsedMarkdownListItem, ParsedMarkdownListItemType, ParsedMarkdownTable,
|
ParsedMarkdownHeading, ParsedMarkdownListItem, ParsedMarkdownListItemType, ParsedMarkdownTable,
|
||||||
ParsedMarkdownTableAlignment, ParsedMarkdownTableRow,
|
ParsedMarkdownTableAlignment, ParsedMarkdownTableRow,
|
||||||
};
|
};
|
||||||
|
use fs::normalize_path;
|
||||||
use gpui::{
|
use gpui::{
|
||||||
AbsoluteLength, AnyElement, App, AppContext as _, ClipboardItem, Context, DefiniteLength, Div,
|
AbsoluteLength, AnyElement, App, AppContext as _, ClipboardItem, Context, DefiniteLength, Div,
|
||||||
Element, ElementId, Entity, HighlightStyle, Hsla, ImageSource, InteractiveText, IntoElement,
|
Element, ElementId, Entity, HighlightStyle, Hsla, ImageSource, InteractiveText, IntoElement,
|
||||||
|
@ -680,7 +681,7 @@ fn render_markdown_text(parsed_new: &MarkdownParagraph, cx: &mut RenderContext)
|
||||||
_ = workspace.update(cx, |workspace, cx| {
|
_ = workspace.update(cx, |workspace, cx| {
|
||||||
workspace
|
workspace
|
||||||
.open_abs_path(
|
.open_abs_path(
|
||||||
path.clone(),
|
normalize_path(path.clone().as_path()),
|
||||||
OpenOptions {
|
OpenOptions {
|
||||||
visible: Some(OpenVisible::None),
|
visible: Some(OpenVisible::None),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue