mirror of
https://github.com/vector-im/element-web.git
synced 2026-03-09 23:41:50 +01:00
Use Linkify+decode for description
This commit is contained in:
parent
b19f5056bd
commit
46d42f6f91
@ -32,7 +32,7 @@ import AccessibleButton from "../elements/AccessibleButton";
|
||||
import { getParentEventId } from "../../../utils/Reply";
|
||||
import { EditWysiwygComposer } from "../rooms/wysiwyg_composer";
|
||||
import { type IEventTileOps } from "../rooms/EventTile";
|
||||
import { UrlPreviewViewModel } from "../../../viewmodels/message-body/UrlPreviewViewModel.ts";
|
||||
import { UrlPreviewViewModel } from "../../../viewmodels/message-body/UrlPreviewViewModel";
|
||||
import { MatrixClientPeg } from "../../../MatrixClientPeg.ts";
|
||||
import { useMediaVisible } from "../../../hooks/useMediaVisible.ts";
|
||||
import ImageView from "../elements/ImageView.tsx";
|
||||
|
||||
@ -13,12 +13,15 @@ import {
|
||||
} from "@element-hq/web-shared-components";
|
||||
import { logger as rootLogger } from "matrix-js-sdk/src/logger";
|
||||
import { type IPreviewUrlResponse, type MatrixClient, MatrixError, type MatrixEvent } from "matrix-js-sdk/src/matrix";
|
||||
import React, { type ReactNode } from "react";
|
||||
|
||||
import { isPermalinkHost } from "../../utils/permalinks/Permalinks";
|
||||
import { mediaFromMxc } from "../../customisations/Media";
|
||||
import PlatformPeg from "../../PlatformPeg";
|
||||
import { thumbHeight } from "../../ImageUtils";
|
||||
import SettingsStore from "../../settings/SettingsStore";
|
||||
import { Linkify } from "../../Linkify";
|
||||
import { decode } from "html-entities";
|
||||
|
||||
const logger = rootLogger.getChild("UrlPreviewViewModel");
|
||||
|
||||
@ -114,7 +117,7 @@ export class UrlPreviewViewModel
|
||||
|
||||
return {
|
||||
title,
|
||||
description,
|
||||
description: description && <Linkify>{decode(description)}</Linkify>,
|
||||
siteName,
|
||||
};
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user