From 932f64b8eb042deb465e236254a760fb700a1695 Mon Sep 17 00:00:00 2001 From: achmizs <1874748+achmizs@users.noreply.github.com> Date: Sat, 11 Dec 2021 03:09:38 -0500 Subject: [PATCH] Added support for dark theme --- pastebin-embed.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pastebin-embed.php b/pastebin-embed.php index 5d722bc..c89bdef 100644 --- a/pastebin-embed.php +++ b/pastebin-embed.php @@ -25,6 +25,9 @@ function PastebinEmbed ($m) { $noLineNumbers = in_array('nolinenums', $args); $raw = in_array('raw', $args); $noPre = in_array('no-pre', $args); + + ## Dark theme, if specified. + $theme = $parsed['theme'] ?: ""; ## Convert the comma-delimited line ranges to an array containing each line to be ## included as values. @@ -60,8 +63,8 @@ function PastebinEmbed ($m) { } } - $embed_js_url = "https://pastebin.com/embed_js/$paste_id"; - $embed_iframe_url = "https://pastebin.com/embed_iframe/$paste_id"; + $embed_js_url = "https://pastebin.com/embed_js/$paste_id" . ($theme ? "?theme={$theme}" : ""); + $embed_iframe_url = "https://pastebin.com/embed_iframe/$paste_id" . ($theme ? "?theme={$theme}" : ""); $embed_raw_url = "https://pastebin.com/raw/$paste_id"; $out = "Unknown error.";