MCPcopy
hub / github.com/tinacms/tinacms / rootElement

Function rootElement

packages/@tinacms/mdx/src/stringify/index.ts:145–162  ·  view source on GitHub ↗
(
  content: Plate.RootElement,
  field: RichTextType,
  imageCallback: (url: string) => string
)

Source from the content-addressed store, hash-verified

143};
144
145export const rootElement = (
146 content: Plate.RootElement,
147 field: RichTextType,
148 imageCallback: (url: string) => string
149): Md.Root => {
150 const children: Md.Content[] = [];
151 content.children?.forEach((child) => {
152 const value = blockElement(child, field, imageCallback);
153
154 if (value) {
155 children.push(value);
156 }
157 });
158 return {
159 type: 'root',
160 children,
161 };
162};
163
164export function codeLinesToString(content: Plate.CodeBlockElement): string {
165 return (content.children || [])

Callers 2

stringifyPropsFunction · 0.70
serializeMDXFunction · 0.70

Calls 2

pushMethod · 0.80
blockElementFunction · 0.70

Tested by

no test coverage detected