Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 4 additions & 6 deletions components/embeds/boxEmbed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { TinaMarkdown } from "tinacms/dist/rich-text";
import { toolbarFields } from "@/tina/collection/shared/toolbarFields";
import MarkdownComponentMapping from "../tina-markdown/markdown-component-mapping";
import { Figure, inlineFigureDefaultItem, inlineFigureFields } from "./figure";
import { youtubeEmbedTemplate } from "./youtubeEmbed";
import { imageEmbedTemplate } from "./imageEmbed";

type BoxVariant = "greybox" | "info" | "todo" | "china" | "codeauditor" | "highlight" | "warning" | "tips";

Expand Down Expand Up @@ -88,19 +90,14 @@ export function BoxEmbed(props: any) {
const figure: string = data?.figure || "";
const figurePrefix: any = data?.figurePrefix || "none";

const components = {
...MarkdownComponentMapping,
a: ({ children }: any) => <span>{children}</span>,
};

return (
<>
<div className={`p-4 rounded-sm my-4 ${config.containerClass}`}>
<div className="flex items-start">
{config.icon}
<div className={`[&_p:last-child]:mb-0 ${config.textClass ?? ""}`}>
<div>
<TinaMarkdown content={data.body} components={components} />
<TinaMarkdown content={data.body} components={MarkdownComponentMapping} />
</div>
</div>
</div>
Expand Down Expand Up @@ -148,6 +145,7 @@ export const boxEmbedTemplate: Template = {
label: "Body",
type: "rich-text",
toolbarOverride: toolbarFields,
templates: [youtubeEmbedTemplate, imageEmbedTemplate],
},
...(inlineFigureFields as any),
],
Expand Down
2 changes: 1 addition & 1 deletion tina/tina-lock.json

Large diffs are not rendered by default.

Loading