jgm / djot

A light markup language
https://djot.net
MIT License
1.63k stars 43 forks source link

Consider generalizing ![image](url) to support any media #181

Open matklad opened 1 year ago

matklad commented 1 year ago

From: https://github.com/jgm/djot.js/pull/4#issuecomment-1371180193

Images are the most common type of external media one wants to embedd into a document, but videos are also fairly popular, so we might want to support that in core djot. And, if we support both images and video, than ![] syntax becomes a general "here's non-textual media".

Note that supporting videos in particular might be tricky. A video might be an .mp4 file, but it might also be, eg, youtube's iframe.

jgm commented 1 year ago

I feel like this could just be a renderer option. The HTML renderer could decide to render .mp4 files as videos, plus anything else marked with a video class. The element could be branded as a generic image-like media element, with some indeterminacy about rendering.

toastal commented 1 year ago

Should this include <audio> and a .ogg file?