Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ private LayoutTypes GetDisplayedLayoutType()
FolderLayoutModes.CardsView => LayoutTypes.Cards,
FolderLayoutModes.GridView => LayoutTypes.Grid,
FolderLayoutModes.ColumnView => LayoutTypes.Columns,
_ => throw new InvalidEnumArgumentException(),
_ => LayoutTypes.Details,
};
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Files.App/ViewModels/Layouts/BaseLayoutViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,14 @@ await _associatedInstance.FilesystemHelpers.PerformOperationTypeAsync(DataPackag
}
}

// Dragged data can carry a malformed URI; GetUriAsync throws UriFormatException for it.
// Dragged data can carry a malformed URI or advertise one it can't deliver; GetUriAsync throws for both.
private static async Task<Uri?> TryGetUriAsync(DataPackageView dataView)
{
try
{
return await dataView.GetUriAsync();
}
catch (UriFormatException)
catch (Exception ex) when (ex is UriFormatException or COMException)
{
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ public MarkdownPreviewViewModel(ListedItem item)
public override async Task<List<FileProperty>> LoadPreviewAndDetailsAsync()
{
var text = await ReadFileAsTextAsync(PreviewFile);
TextValue = EscapeRawHtml(text.Left(Constants.PreviewPane.TextCharacterLimit));
var markdown = EscapeRawHtml(text.Left(Constants.PreviewPane.TextCharacterLimit));

// Markdown that Markdig rejects would otherwise throw inside MarkdownTextBlock during layout
Markdig.Markdown.Parse(markdown);

TextValue = markdown;

return [];
}
Expand Down
Loading