From 82d3d88d01be0e1d6d624bee80ed87599f855799 Mon Sep 17 00:00:00 2001 From: Evan Czaplicki Date: Tue, 17 Dec 2013 16:10:17 -0800 Subject: [PATCH] Get syntax highlighting on code blocks working again. --- compiler/Generate/Markdown.hs | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/compiler/Generate/Markdown.hs b/compiler/Generate/Markdown.hs index 226b105..b6dad6f 100644 --- a/compiler/Generate/Markdown.hs +++ b/compiler/Generate/Markdown.hs @@ -1,6 +1,39 @@ module Generate.Markdown where import Text.Pandoc +import qualified Data.Set as Set toHtml :: String -> String -toHtml = writeHtmlString def . readMarkdown def \ No newline at end of file +toHtml = writeHtmlString writeOptions . readMarkdown readOptions + +readOptions = + def { readerExtensions = elmExtensions + , readerApplyMacros = False + } + +writeOptions = + def { writerExtensions = elmExtensions + , writerHighlight = True + } + +elmExtensions :: Set.Set Extension +elmExtensions = Set.fromList + [ Ext_raw_html + , Ext_fenced_code_blocks + , Ext_fenced_code_attributes + , Ext_backtick_code_blocks + , Ext_inline_code_attributes + , Ext_markdown_in_html_blocks + , Ext_escaped_line_breaks + , Ext_fancy_lists + , Ext_startnum + , Ext_definition_lists + , Ext_example_lists + , Ext_all_symbols_escapable + , Ext_intraword_underscores + , Ext_blank_before_blockquote + , Ext_blank_before_header + , Ext_auto_identifiers + , Ext_header_attributes + , Ext_implicit_header_references + ] \ No newline at end of file