Update composer to preview external link cards (#52)

* Fetch external link metadata during compose so the user can preview and remove the embed

* Add missing mocks

* Update tests to match recent changes
This commit is contained in:
Paul Frazee 2023-01-18 18:14:46 -06:00 committed by GitHub
parent 27ee550d15
commit 6588961d2e
9 changed files with 262 additions and 64 deletions

View file

@ -96,7 +96,7 @@ export function extractEntities(
{
// links
const re =
/(^|\s|\()((https?:\/\/[\S]+)|((?<domain>[a-z][a-z0-9]*(\.[a-z0-9]+)+)[\S]*))/gm
/(^|\s|\()((https?:\/\/[\S]+)|((?<domain>[a-z][a-z0-9]*(\.[a-z0-9]+)+)[\S]*))/gim
while ((match = re.exec(text))) {
let value = match[2]
if (!value.startsWith('http')) {