Skip to content
This repository was archived by the owner on Jan 6, 2019. It is now read-only.

Commit 8fb08cc

Browse files
committed
Handle missing syntaxes
1 parent a352b52 commit 8fb08cc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/Main.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,24 +210,24 @@ getPasteR pid = do
210210
<em>
211211
#{pasteAuthor paste}
212212
#{show (pasteCreated paste)}
213-
<table>
214-
#{highlightAs language (pasteContent paste)}
213+
#{highlightAs language (pasteContent paste)}
215214
|]
216215

217216
highlightAs :: Text -> Text -> H.Html
218217
highlightAs lang src =
219218
case syntaxByName defaultSyntaxMap lang of
220-
Nothing -> toHtml src
219+
Nothing -> H.pre (toHtml src)
221220
Just syntax ->
222221
case tokenize
223222
TokenizerConfig {syntaxMap = defaultSyntaxMap, traceOutput = False}
224223
syntax
225224
src of
226-
Left {} -> toHtml src
225+
Left {} -> H.pre (toHtml src)
227226
Right toks -> tokensToHtml toks
228227

229228
tokensToHtml :: [[(TokenType, Text)]] -> H.Html
230229
tokensToHtml =
230+
H.table .
231231
foldMap
232232
(\(i, line) ->
233233
H.tr H.! A.id ("line" <> fromString (show i)) $ do

0 commit comments

Comments
 (0)