mirror of https://github.com/status-im/codimd.git
Update to support haskell syntax highlighting in code block
This commit is contained in:
parent
c671d54d67
commit
09e6596074
|
@ -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 = {
|
||||
|
|
|
@ -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 = [
|
||||
{
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -43,6 +43,7 @@ mode/python/python.js \
|
|||
mode/shell/shell.js \
|
||||
mode/php/php.js \
|
||||
mode/sql/sql.js \
|
||||
mode/haskell/haskell.js \
|
||||
mode/coffeescript/coffeescript.js \
|
||||
mode/yaml/yaml.js \
|
||||
mode/pug/pug.js \
|
||||
|
|
Loading…
Reference in New Issue