<commit_before>module Text.Markdown (toHTML) where

import Text.Pandoc ( Pandoc
                   , readMarkdown
                   , writeHtmlString
                   , def
                   )

import Data.ByteString.Lazy.Char8 (ByteString, pack)

writeHTMLStr :: Pandoc -> String
writeHTMLStr = writeHtmlString def

-- Function for translating Markdown to HTML since `Pandoc` has several
-- different generators for other markup languages.
toHTML :: String -> ByteString
toHTML = pack . writeHTMLStr . parse
  where parse = readMarkdown def
{-# INLINE toHTML #-}
<commit_msg>Move `writeHTMLStr` back into `toHTML` function<commit_after>module Text.Markdown (toHTML) where

import Text.Pandoc ( readMarkdown
                   , writeHtmlString
                   , def
                   )

import Data.ByteString.Lazy.Char8 (ByteString, pack)

-- Function for translating Markdown to HTML since `Pandoc` has several
-- different generators for other markup languages.
toHTML :: String -> ByteString
toHTML = pack . writeHTMLStr . parse
  where parse = readMarkdown def
        writeHTMLStr = writeHtmlString def
{-# INLINE toHTML #-}

{'fraction_non_alphanumeric': 0.07631578947368421, 'fraction_numerical': 0.0017543859649122807, 'mean_word_length': 2.6107594936708862, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '3584339', 'n_tokens_mistral': 316, 'n_tokens_neox': 302, 'n_words': 99}