Skip to content

Commit

Permalink
Merge pull request #550 from prezly/feature/care-4591-editor-request-…
Browse files Browse the repository at this point in the history
…allow-pasting-in-links-inline-within-a

[CARE-4591] Fix - Only allow URL bookmark autoformatting in empty paragraphs
  • Loading branch information
kudlajz authored Jul 9, 2024
2 parents 3d3c290 + 706804a commit 04f8fee
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -449,11 +449,17 @@ function buildPlaceholdersExtensionConfiguration({
? {
isAllowed(editor) {
const isSelectionEmpty = EditorCommands.isSelectionEmpty(editor);
const isSelectionInEmptyParagraph =
EditorCommands.isCursorInEmptyParagraph(editor);
const isInsideTable = TablesEditor.isTablesEditor(editor)
? TablesEditor.isInTable(editor)
: false;

return isSelectionEmpty && !isInsideTable;
return (
isSelectionEmpty &&
isSelectionInEmptyParagraph &&
!isInsideTable
);
},
...withPlaceholders.withPastedUrlsUnfurling,
}
Expand Down

0 comments on commit 04f8fee

Please sign in to comment.