mirror of
https://github.com/makeplane/plane.git
synced 2026-07-13 05:49:40 +02:00
[WIKI-481] regression: editor parser build error
This commit is contained in:
committed by
GitHub
parent
73042d026c
commit
f7f9d7e830
@@ -14,7 +14,7 @@ import { convertHTMLDocumentToAllFormats } from "./yjs-utils";
|
||||
* @param htmlContent
|
||||
* @returns {string[]} array of asset sources
|
||||
*/
|
||||
const extractAssetsFromHTMLContent = (htmlContent: string): string[] => {
|
||||
export const extractAssetsFromHTMLContent = (htmlContent: string): string[] => {
|
||||
// create a DOM parser
|
||||
const parser = new DOMParser();
|
||||
// parse the HTML string into a DOM document
|
||||
|
||||
@@ -3,7 +3,7 @@ import { observer } from "mobx-react";
|
||||
import useSWR from "swr";
|
||||
// plane imports
|
||||
import { ETemplateLevel, ETemplateType } from "@plane/constants";
|
||||
import { extractImageAssetsFromHTMLContent } from "@plane/editor";
|
||||
import { extractAssetsFromHTMLContent } from "@plane/editor";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { PartialDeep, TPageTemplateForm } from "@plane/types";
|
||||
import { setToast, TOAST_TYPE } from "@plane/ui";
|
||||
@@ -174,10 +174,10 @@ export const CreateUpdatePageTemplate: React.FC<Props> = observer((props) => {
|
||||
.then(async (response) => {
|
||||
// Extract image assets from the description and attach them to the page template
|
||||
if (response?.id && response?.template_data.description_html) {
|
||||
const uploadedImageAssets = extractImageAssetsFromHTMLContent(response.template_data.description_html);
|
||||
if (uploadedImageAssets.length > 0) {
|
||||
const uploadedAssets = extractAssetsFromHTMLContent(response.template_data.description_html);
|
||||
if (uploadedAssets.length > 0) {
|
||||
await fileService.updateBulkWorkspaceAssetsUploadStatus(workspaceSlug, response.id, {
|
||||
asset_ids: uploadedImageAssets,
|
||||
asset_ids: uploadedAssets,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user