mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 11:16:31 -05:00
Update to support haskell syntax highlighting in code block
This commit is contained in:
parent
c671d54d67
commit
09e6596074
4 changed files with 20 additions and 13 deletions
|
@ -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 = [
|
||||
{
|
||||
|
|
24
public/vendor/codemirror/codemirror.min.js
vendored
24
public/vendor/codemirror/codemirror.min.js
vendored
File diff suppressed because one or more lines are too long
1
public/vendor/codemirror/compress.sh
vendored
1
public/vendor/codemirror/compress.sh
vendored
|
@ -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 a new issue