Update src/Markdig/Extensions/MediaLinks/MediaLinkExtension.cs

Co-authored-by: Günther Foidl <gue@korporal.at>
This commit is contained in:
Rick Strahl
2023-07-13 12:04:52 -07:00
committed by GitHub
parent 81bc58c6c9
commit 3d29430337

View File

@@ -98,11 +98,9 @@ public class MediaLinkExtension : IMarkdownExtension
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('.');