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 2acc7ed107
commit 626f85651f
9 changed files with 262 additions and 64 deletions
+1 -1
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')) {