From 7034c58544d04f1593d2d45919d78ce098046d4b Mon Sep 17 00:00:00 2001 From: Kiko Beats Date: Sat, 5 Aug 2023 13:34:03 +0200 Subject: [PATCH] feat: add type markup property for video/audio --- src/html.js | 4 ++-- test/html/snapshots/index.js.md | 8 ++++++-- test/html/snapshots/index.js.snap | Bin 3540 -> 3566 bytes test/snapshots/index.js.md | 8 ++++++-- test/snapshots/index.js.snap | Bin 710 -> 738 bytes 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/html.js b/src/html.js index adb6de5..27b9fe2 100644 --- a/src/html.js +++ b/src/html.js @@ -79,9 +79,9 @@ const addBody = ({ url, headers, html }) => { if (isMime(contentType, 'image')) { element = `` } else if (isMime(contentType, 'video')) { - element = `` + element = `` } else if (isMime(contentType, 'audio')) { - element = `` + element = `` } else if (mimeExtension(contentType) === 'json') { element = `
${html}
` } diff --git a/test/html/snapshots/index.js.md b/test/html/snapshots/index.js.md index ab5c75e..c1df5b5 100644 --- a/test/html/snapshots/index.js.md +++ b/test/html/snapshots/index.js.md @@ -89,7 +89,9 @@ Generated by [AVA](https://avajs.dev). ␊ ␊ - ␊ + ␊ ` ## add video markup @@ -103,7 +105,9 @@ Generated by [AVA](https://avajs.dev). ␊ ␊ - ␊ + ␊ ` ## '`rewriteCssUrls` don't modify html markup diff --git a/test/html/snapshots/index.js.snap b/test/html/snapshots/index.js.snap index 84a191f2cd3a6c590450448a066be0793424af3e..2a804410fe20ad52d80bff7783e262c36fa11f11 100644 GIT binary patch literal 3566 zcmVT;Ww>o^@0z6k*pjVS*_CC-ah=3* z9A}d(7TFOwBF7qXm>E*ClKRl1Kzrz|r=lo|?Wt(@(o>6`dg?dm7byAx_Rw?NH$zDl zB}%p&r%8YquuTrxh|MLyMh#9MJl zM1Vr!u}J**OUFSGdhoBe-}=T|^5@dKZ+-jnKi*oqvawsg_wdf961(=^TJlfR);x?H zc>$MdjB72@VhxNUVcN`Jvy#T7gO4Mmg`9<$N8PH<+=?I(ejFel>zd7i2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vapiGkR`Z>N ztqkk^J!QSWWLxjec$Iq&h@a@wbDMq@uP z{1}pRA|k_M0pr3zO%6N>45VJlLZ)D}2&LFD8eJm}S-n9z3Le9vQj9l3|_gbdV8Vo^^fOuF_+4(J)uC7Td8-m#iSIi~cRULMwV35$9 z(4*2Jfx|kcdOR-)DB5oSR2T+`1=fxv3YA3iLwSIxBDj%g1ja(2z69(`AigF-6kNY6 zpF@MZUbD~?Qs+-0H6X9f*);Wj7H|~ftbS+Y?C&kB-(*%NlY!ipMyzs(gHIX9Am4lK z+GEpD&!#%^m*;Sm5d5LTxbvx`KIT@4B2Ph*B}OQgFLzFQX7vgJr9J6Yk>WJl0QfsQFVIN_q?=58D}j zbmea;Kl=0Q>__-Wy_Gv}Ix-|agJ+CNWm9AHS%{!gu z;p1GB)1vjPTeje*Q+u(W`pxC_TB}xDuhniPEqn61R(tSZyS~5sc#GEeYE1mN3V(r_8wW!9UN}&)ylets60)L5ZASY8G611 zrohDYB6U55{>4-14+$D>LYm}gD2g~~#E?{HB+Z|sJRx_!q}>hO zEwkA>T(W9%K7s+`DRbxNTrMk&z!h@~{kOBHRH9*0nSe7NCZB_41f5@`ppIYXpz|UI zom|L_oC?dKha*)mxpVfx=!KSA*=J+P*!>K_=)t})@g$9M2YrRKf-wvF)^nRKUdMaVx{auQ%zkc^EVP7Z0 z_DBBZDb@^i2jJU8eyP$$`FqA!>*&DtX OCjAc}GxoN=H~;|gqskEg diff --git a/test/snapshots/index.js.md b/test/snapshots/index.js.md index 65f4211..4937dc8 100644 --- a/test/snapshots/index.js.md +++ b/test/snapshots/index.js.md @@ -16,7 +16,9 @@ Generated by [AVA](https://avajs.dev). ␊ ␊ - ␊ + ␊ ` ## from image URL @@ -45,7 +47,9 @@ Generated by [AVA](https://avajs.dev). ␊ ␊ - ␊ + ␊ ` ## from bad SSL URL diff --git a/test/snapshots/index.js.snap b/test/snapshots/index.js.snap index a50a7fb5b756f8986a21593aa67003b4645fa7ff..32962e0bc57624367ee5d030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