import { marked } from 'marked'

export function useMarkdown() {
  const renderMarkdown = (content: string): string => {
    if (!content) return ''
    return marked.parse(content) as string
  }

  return {
    renderMarkdown,
  }
}

export function parseMarkdown(content: string): string {
  if (!content) return ''
  return marked.parse(content) as string
}
