Skip to content

Commit

Permalink
Fix: cheerio
Browse files Browse the repository at this point in the history
  • Loading branch information
Martijn-Schoenmaker-Webbio committed Oct 8, 2024
1 parent 7376845 commit f7e1d7d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { groupBy, update, get, merge } from 'lodash';
import { Common } from '@strapi/strapi';

import cheerio from 'cheerio';
import { load } from 'cheerio';

import { deserializeLink, getCustomFields, getPopulatedEntity, sanitizeEntity, serializeLink } from '../utils/strapi';
import { InternalLink } from '../interfaces/link';
Expand Down Expand Up @@ -378,7 +378,7 @@ const getInternalLinksFromHtml = ({ key, value }) => {
return [];
}
const wysiwygFieldValue = value;
const $ = cheerio.load(wysiwygFieldValue, null, false);
const $ = load(wysiwygFieldValue, null, false);

// Get all links that have the data-internal-link attribute
const serializedLinks = $('[data-internal-link]')
Expand All @@ -404,7 +404,7 @@ const getInternalLinksFromHtml = ({ key, value }) => {

const updateInternalLinksInHtml = (html, internalLinks) => {
const wysiwygFieldValue = html;
const $ = cheerio.load(wysiwygFieldValue, null, false);
const $ = load(wysiwygFieldValue, null, false);
let internalLinkIdx = 0;

// @ts-ignore
Expand Down

0 comments on commit f7e1d7d

Please sign in to comment.