Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apps/builder/app/shared/copy-paste/plugin-html.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import { generateFragmentFromHtml } from "../html";
import { insertWebstudioFragmentAt } from "../instance-utils";
import { generateFragmentFromTailwind } from "../tailwind/tailwind";
import { denormalizeSrcProps } from "./asset-upload";
import type { Plugin } from "./init-copy-paste";

const inceptionMark = `<!-- Generated with Inception by Webstudio -->`;

export const html: Plugin = {
name: "html",
mimeType: "text/plain",
onPaste: async (html: string) => {
let fragment = generateFragmentFromHtml(html);
fragment = await denormalizeSrcProps(fragment);
if (html.includes(inceptionMark)) {
fragment = await generateFragmentFromTailwind(fragment);
}
const result = insertWebstudioFragmentAt(fragment);
return result;
},
Expand Down