diff --git a/src/Markdig/Extensions/MediaLinks/MediaLinkExtension.cs b/src/Markdig/Extensions/MediaLinks/MediaLinkExtension.cs index 5d0953d99..a027f6a77 100644 --- a/src/Markdig/Extensions/MediaLinks/MediaLinkExtension.cs +++ b/src/Markdig/Extensions/MediaLinks/MediaLinkExtension.cs @@ -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('.');