diff --git a/src/UI_Components/Markdown.re b/src/UI_Components/Markdown.re index f9cb4290c..cf29f6174 100644 --- a/src/UI_Components/Markdown.re +++ b/src/UI_Components/Markdown.re @@ -56,7 +56,8 @@ module SyntaxHighlight = { bold: bool, italic: bool, } - and t = (~language: string, list(string)) => list(list(highlight)); + and t = + (~language: option(string), list(string)) => list(list(highlight)); let makeHighlight = (~byteIndex, ~color, ~bold, ~italic): highlight => { byteIndex, @@ -407,20 +408,8 @@ and generateCodeBlock = ); - {switch (label, codeBlock.code) { - | (None, Some(code)) => - - - | (Some(label), Some(code)) => + {switch (codeBlock.code) { + | Some(code) => let lines = String.split_on_char('\n', code); let highlights = highlighter(~language=label, lines); List.map2( @@ -460,7 +449,7 @@ and generateCodeBlock = ) |> React.listToElement; - | (_, _) => + | None => }} ; }; diff --git a/src/UI_Components/Markdown.rei b/src/UI_Components/Markdown.rei index 4a77b0151..694835b6d 100644 --- a/src/UI_Components/Markdown.rei +++ b/src/UI_Components/Markdown.rei @@ -1,6 +1,7 @@ module SyntaxHighlight: { type highlight; - type t = (~language: string, list(string)) => list(list(highlight)); + type t = + (~language: option(string), list(string)) => list(list(highlight)); let default: t;