Skip to content

Commit

Permalink
Update src/Markdig/Extensions/MediaLinks/MediaLinkExtension.cs
Browse files Browse the repository at this point in the history
Co-authored-by: Günther Foidl <[email protected]>
  • Loading branch information
RickStrahl and gfoidl authored Jul 13, 2023
1 parent 81bc58c commit 3d29430
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Markdig/Extensions/MediaLinks/MediaLinkExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,9 @@ private static HtmlAttributes GetHtmlAttributes(LinkInline linkInline)

private bool TryGuessAudioVideoFile(Uri uri, bool isSchemaRelative, HtmlRenderer renderer, LinkInline linkInline)
{
string path;
if (uri.IsAbsoluteUri)
path = uri.GetComponents(UriComponents.Path, UriFormat.Unescaped);
else
path = uri.ToString();
string path = uri.IsAbsoluteUri
? uri.GetComponents(UriComponents.Path, UriFormat.Unescaped)
: uri.ToString();

// Otherwise try to detect if we have an audio/video from the file extension
var lastDot = path.LastIndexOf('.');
Expand Down

0 comments on commit 3d29430

Please sign in to comment.