<commit_before>module Hyakko.Text.Markdown (toHTML) where

import Text.Pandoc ( readMarkdown
                   , writeHtmlString
                   , def
                   )

import Data.Text (Text, pack)

-- Function for translating Markdown to HTML since `Pandoc` has several
-- different generators for other markup languages.
toHTML :: String -> Text
toHTML string =
  let parsedOutput = readMarkdown def string
      emptyText _  = empty
  in either emptyText (pack . writeHtmlString def) parsedOutput
{-# INLINE toHTML #-}<commit_msg>Change import structure<commit_after>module Hyakko.Text.Markdown (toHTML) where

import Data.Text (Text, pack, empty)
import Text.Pandoc (readMarkdown, writeHtmlString, def)

-- Function for translating Markdown to HTML since `Pandoc` has several
-- different generators for other markup languages.
toHTML :: String -> Text
toHTML string =
  let parsedOutput = readMarkdown def string
      emptyText _  = empty
  in either emptyText (pack . writeHtmlString def) parsedOutput
{-# INLINE toHTML #-}
{'fraction_non_alphanumeric': 0.07603464870067372, 'fraction_numerical': 0.0, 'mean_word_length': 3.369747899159664, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6059557', 'n_tokens_mistral': 291, 'n_tokens_neox': 280, 'n_words': 103}