import { parsers } from "prettier/parser-markdown" ; const filterBody = ( body ) : string => { const trimmedBody = body . trim ( ) ; const { children } = parsers . markdown . parse ( trimmedBody ) ; const firstThematicBreak = children . find ( ( { type } ) => type === "thematicBreak" ) ; return firstThematicBreak === undefined ? trimmedBody : trimmedBody . slice ( 0 , firstThematicBreak . position . start . offset ) . trim ( ) ; } ; export { filterBody } ;