Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit db5c001

Browse files
committed
Add dev dependency for parse5 typings
1 parent 683aec1 commit db5c001

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
"@types/modernizr": "^3.5.3",
133133
"@types/node": "^14.14.22",
134134
"@types/pako": "^1.0.1",
135+
"@types/parse5": "^6.0.0",
135136
"@types/qrcode": "^1.3.5",
136137
"@types/react": "^16.9",
137138
"@types/react-dom": "^16.9.10",

src/SlashCommands.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import {isPermalinkHost, parsePermalink} from "./utils/permalinks/Permalinks";
3838
import {inviteUsersToRoom} from "./RoomInvite";
3939
import { WidgetType } from "./widgets/WidgetType";
4040
import { Jitsi } from "./widgets/Jitsi";
41-
import { parseFragment as parseHtml } from "parse5";
41+
import { parseFragment as parseHtml, Element as ChildElement } from "parse5";
4242
import BugReportDialog from "./components/views/dialogs/BugReportDialog";
4343
import { ensureDMExists } from "./createRoom";
4444
import { ViewUserPayload } from "./dispatcher/payloads/ViewUserPayload";
@@ -856,7 +856,7 @@ export const Commands = [
856856
// some superfast regex over the text so we don't have to.
857857
const embed = parseHtml(widgetUrl);
858858
if (embed && embed.childNodes && embed.childNodes.length === 1) {
859-
const iframe = embed.childNodes[0];
859+
const iframe = embed.childNodes[0] as ChildElement;
860860
if (iframe.tagName.toLowerCase() === 'iframe' && iframe.attrs) {
861861
const srcAttr = iframe.attrs.find(a => a.name === 'src');
862862
console.log("Pulling URL out of iframe (embed code)");

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,6 +1594,11 @@
15941594
resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0"
15951595
integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==
15961596

1597+
"@types/parse5@^6.0.0":
1598+
version "6.0.0"
1599+
resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-6.0.0.tgz#38590dc2c3cf5717154064e3ee9b6947ee21b299"
1600+
integrity sha512-oPwPSj4a1wu9rsXTEGIJz91ISU725t0BmSnUhb57sI+M8XEmvUop84lzuiYdq0Y5M6xLY8DBPg0C2xEQKLyvBA==
1601+
15971602
"@types/prettier@^2.0.0":
15981603
version "2.1.6"
15991604
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.1.6.tgz#f4b1efa784e8db479cdb8b14403e2144b1e9ff03"

0 commit comments

Comments
 (0)