From 8513200900cc4127d3c41953f57a09c91148c4e1 Mon Sep 17 00:00:00 2001 From: Aditya Sharma <65771169+adityash1@users.noreply.github.com> Date: Mon, 5 Dec 2022 01:11:03 +0530 Subject: [PATCH] fix: Don't embed pasted links in list (#4535) closes https://github.com/outline/outline/issues/4154 --- shared/editor/plugins/PasteHandler.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/shared/editor/plugins/PasteHandler.ts b/shared/editor/plugins/PasteHandler.ts index 909e0361d..f722582bd 100644 --- a/shared/editor/plugins/PasteHandler.ts +++ b/shared/editor/plugins/PasteHandler.ts @@ -6,6 +6,7 @@ import Extension from "../lib/Extension"; import isMarkdown from "../lib/isMarkdown"; import normalizePastedMarkdown from "../lib/markdown/normalize"; import isInCode from "../queries/isInCode"; +import isInList from "../queries/isInList"; import { LANGUAGES } from "./Prism"; function isDropboxPaper(html: string): boolean { @@ -76,7 +77,12 @@ export default class PasteHandler extends Extension { // Is this link embeddable? Create an embed! const { embeds } = this.editor.props; - if (embeds && !isInTable(state) && !isInCode(state)) { + if ( + embeds && + !isInTable(state) && + !isInCode(state) && + !isInList(state) + ) { for (const embed of embeds) { const matches = embed.matcher(text); if (matches) {