Skip to content

Commit

Permalink
Fix wysiwyg oembeds
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Nov 21, 2023
1 parent 7a6b5ac commit 9509126
Show file tree
Hide file tree
Showing 3 changed files with 362 additions and 360 deletions.
2 changes: 1 addition & 1 deletion src/components/elements/wysiwyg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ const cleanMediaMarkup = (node: Element) => {
}

const getOembedUrl = (node: Element): string | undefined => {
const src = node.attribs?.src;
const src = node.attribs?.src || node.attribs['data-src'];
if (src?.startsWith('/media/oembed')) {
return decodeURIComponent(src as string).replace(/^.*url=(.*)?&.*$/, '$1');
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/drupal/get-access-token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function getAccessToken(draftMode: boolean = false): Promise<Access
`${process.env.NEXT_PUBLIC_DRUPAL_BASE_URL}/oauth/token`,
{
method: "POST",
cache: "no-store",
next: {revalidate: 30},
headers: {
Authorization: `Basic ${basic}`,
"Content-Type": "application/x-www-form-urlencoded",
Expand Down
Loading

0 comments on commit 9509126

Please sign in to comment.