diff options
author | Wu Cheng-Han | 2016-11-18 12:17:37 +0800 |
---|---|---|
committer | Wu Cheng-Han | 2016-11-18 12:17:37 +0800 |
commit | 09e6596074de176fa97efdb63062f19f6881b160 (patch) | |
tree | 8169ea9b40f2227d8c0997253992057add77644b /public/js | |
parent | c671d54d6755b8e164428214216e13351f92d09c (diff) |
Update to support haskell syntax highlighting in code block
Diffstat (limited to '')
-rw-r--r-- | public/js/extra.js | 6 | ||||
-rw-r--r-- | public/js/index.js | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/public/js/extra.js b/public/js/extra.js index 05d00780..36d0e676 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -2,6 +2,7 @@ require('prismjs/themes/prism.css'); var Prism = require('prismjs'); require('prismjs/components/prism-wiki'); +require('prismjs/components/prism-haskell'); var hljs = require('highlight.js'); var PDFObject = require('pdfobject'); var S = require('string'); @@ -484,6 +485,11 @@ function finishView(view) { var result = { value: code }; + } else if (reallang == "haskell") { + code = S(code).unescapeHTML().s; + var result = { + value: Prism.highlight(code, Prism.languages.haskell) + }; } else if (reallang == "tiddlywiki" || reallang == "mediawiki") { code = S(code).unescapeHTML().s; var result = { diff --git a/public/js/index.js b/public/js/index.js index 35f63839..9c7ac633 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -213,7 +213,7 @@ var cursorMenuThrottle = 50; var cursorActivityDebounce = 50; var cursorAnimatePeriod = 100; var supportContainers = ['success', 'info', 'warning', 'danger']; -var supportCodeModes = ['javascript', 'htmlmixed', 'htmlembedded', 'css', 'xml', 'clike', 'clojure', 'ruby', 'python', 'shell', 'php', 'sql', 'coffeescript', 'yaml', 'pug', 'lua', 'cmake', 'nginx', 'perl', 'sass', 'r', 'dockerfile', 'tiddlywiki', 'mediawiki']; +var supportCodeModes = ['javascript', 'htmlmixed', 'htmlembedded', 'css', 'xml', 'clike', 'clojure', 'ruby', 'python', 'shell', 'php', 'sql', 'haskell', 'coffeescript', 'yaml', 'pug', 'lua', 'cmake', 'nginx', 'perl', 'sass', 'r', 'dockerfile', 'tiddlywiki', 'mediawiki']; var supportCharts = ['sequence', 'flow', 'graphviz', 'mermaid']; var supportHeaders = [ { |