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:
parent
27ee550d15
commit
6588961d2e
9 changed files with 262 additions and 64 deletions
|
@ -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')) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue