UNPKG

@onereach/channel-transformer

Version:

Convert data model between different channels (Slack, Microsoft Teams, Generic...)

18 lines (16 loc) 539 B
import { IGenericSection } from '../../../generic/types'; import { IOutputHtml } from '../../types'; import { transformText } from './text'; // import { toMarkdown } from '../../../../helpers/html-to-md'; export const transformOutputHtml = (msg: IOutputHtml): IGenericSection => { // const mdText: string = toMarkdown(msg.value); const text = transformText(msg.value); if (text && text.props) { text.props.type = 'html'; } const result: IGenericSection = { type: 'section', children: [text] }; return result; };