qjebbs / vscode-markdown-extended

Extended syntaxes to built-in markdown & What you see is what you get exporter.
MIT License
125 stars 25 forks source link

A HTML `<video>` tag using a workspace relative path does not get rendered in the Markdwon Preview tab #156

Open RalfReddings opened 9 months ago

RalfReddings commented 9 months ago

Hello, I use your amazing extension to get video linking support for both Markdown ![]() and HTML <video> tags, VsCode's Markdown Preview does not natively support linking to videos in either Markup's.

I much prefer to use HTML <video> tag as that allows for advanced features such as autoplay, loop, nocontrols etc but there is a slight bug when using the <video>, when using paths that are relative to the workspace folder, the video does not get shown in the Markdown Preview tab.

This VsCode article mentions you can use ./ (or just the file name) to keep the path relative to current file and use / to keep the path relative to the workspace folder.

For example, when Linking to a video. All the first 5 examples work just fine in Markdown Preview tab, as shown HERE:

# Markdown Example
![](vid.mp4)                                            <!-- vid.mp4 is in the same folder as the .md document -->
![](./vid.mp4)                                              <!-- vid.mp4 is in the same folder as the .md document -->
![](/_MDmedia/vid.mp4)                                  <!-- vid.mp4 is in the _MDmedia folder -->

# HTML Example
<video autoplay loop muted src="vid.mp4"></video> 
<video autoplay loop muted src="./vid.mp4"></video> 
<video autoplay loop muted src="/_MDmedia/vid.mp4"></video>

The last example, <video autoplay loop muted src="/_MDmedia/vid.mp4"></video> does not get rendered in the preview at all.

I work with video a lot and was really pleased to finally discover your extension being the only one that enables support for it, amongst other things. Could you by any chance look into why the <video> tag does not work with paths that are relative to the workspace?

If I am treading outside the scope of the extension, then could I by any chance ask you implement the following options for the MD tag ![]()

A good example that implements this feature, is the extension for Obsidian, media-extended, it does this with syntax like:

![[example.mp4#t=1,2&loop&mute]]

I look forward to hearing from you. and cheers for creating this extnesion.