From 182e6f08169469322ee71aef564efd3f6b9c3c53 Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Sun, 21 Mar 2021 21:20:49 -0700 Subject: [PATCH] customembed: drop and --- src/customembed.js | 69 ++------------------------------------------- test/customembed.js | 38 +++++++++++++++++++++---- 2 files changed, 34 insertions(+), 73 deletions(-) diff --git a/src/customembed.js b/src/customembed.js index ff87b13d..87f42bd6 100644 --- a/src/customembed.js +++ b/src/customembed.js @@ -20,77 +20,12 @@ function filter(input) { } function getMeta($) { - var tag = $("embed"); - if (tag.length !== 0) { - return filterEmbed(tag[0]); - } - tag = $("object"); - if (tag.length !== 0) { - return filterObject(tag[0]); - } - tag = $("iframe"); + let tag = $("iframe"); if (tag.length !== 0) { return filterIframe(tag[0]); } - throw new Error("Invalid embed. Input must be an '; assert.throws(() => { customembed.filter(input) }, /must be HTTPS/); }); + + it('accepts a valid iframe', () => { + let input = '