diff --git a/README.md b/README.md index 8b00f44..0f7d518 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,8 @@ External URLs must use `http://` or `https://`. Uploaded files and remote URLs c When adding an external URL, the admin form can fetch title, description, duration, thumbnail metadata, and readable provider view counts through oEmbed, page metadata, and JSON-LD. The save action repeats the metadata lookup as a fallback, so blank titles can be filled from supported external pages even if the browser autofill was not used. +Descriptions support Markdown, sanitized HTML, and rich pasted HTML from provider pages such as YouTube. Public pages render formatting while catalogue cards and social metadata use safe plain-text excerpts. + If no thumbnail image is uploaded, the add/edit forms can auto-grab one from the first supported source. YouTube and Dailymotion use direct thumbnail URLs; Vimeo, Wistia, TikTok, SoundCloud, and Spotify use oEmbed when available. Local uploaded videos can generate a first-frame thumbnail when `ffmpeg` is installed on the server. Uploaded M4A files also use `ffmpeg` to create a black-frame H.264 MP4 playback source while keeping the original M4A source. ### Live Homepage Option diff --git a/admin/add.php b/admin/add.php index 4a39b31..1d27402 100644 --- a/admin/add.php +++ b/admin/add.php @@ -9,7 +9,7 @@ $msg = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $title = trim($_POST['title'] ?? ''); - $description = trim($_POST['description'] ?? ''); + $description = media_prepare_description_for_storage($_POST['description'] ?? ''); $duration = (int)($_POST['duration'] ?? 0); $sort_order = (int)($_POST['sort_order'] ?? 0); $published = isset($_POST['published']) ? 1 : 0; @@ -40,7 +40,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $metadata = media_external_metadata($url); $source_metadata[$url] = $metadata; if ($title === '' && $metadata['title'] !== '') $title = $metadata['title']; - if ($description === '' && $metadata['description'] !== '') $description = $metadata['description']; + if ($description === '' && $metadata['description'] !== '') { + $description = media_prepare_description_for_storage($metadata['description']); + } if ($duration <= 0 && (int)$metadata['duration'] > 0) $duration = (int)$metadata['duration']; if ((int)$metadata['view_count'] > $initial_external_view_count) { $initial_external_view_count = (int)$metadata['view_count']; @@ -291,8 +293,8 @@ render_head('Add Video — Admin', ' Leave blank when pasting a supported external URL, then use Fetch Info.