import { Token, TokenGroup } from "../../../types/Token"; import { HtmlParagraphElement } from "../../../types/html/HtmlParagraphElement"; import { HtmlElementType } from "../../../types/html/HtmlElementType"; export function processParagraph( classes: string[], body: Token[] ): HtmlParagraphElement | null { const text = body.find( x => x.group === TokenGroup.Custom && x.section === 'string' ); const binding = body.find( x => x.group === TokenGroup.Custom && x.section === 'binding' ); return { type: 'html', tag: HtmlElementType.Paragraph, classes, text: text ? text.key : binding ? binding.key : '' } }