Update to support go in code block syntax highlighting

This commit is contained in:
Wu Cheng-Han 2016-11-26 22:48:20 +08:00
parent 79d5b2c37f
commit b43e63dd21
4 changed files with 9 additions and 7 deletions

View File

@ -3,6 +3,7 @@ require('prismjs/themes/prism.css');
var Prism = require('prismjs');
require('prismjs/components/prism-wiki');
require('prismjs/components/prism-haskell');
require('prismjs/components/prism-go');
var hljs = require('highlight.js');
var PDFObject = require('pdfobject');
var S = require('string');
@ -474,10 +475,10 @@ function finishView(view) {
var result = {
value: code
};
} else if (reallang == "haskell") {
} else if (reallang == "haskell" || reallang == "go") {
code = S(code).unescapeHTML().s;
var result = {
value: Prism.highlight(code, Prism.languages.haskell)
value: Prism.highlight(code, Prism.languages[reallang])
};
} else if (reallang == "tiddlywiki" || reallang == "mediawiki") {
code = S(code).unescapeHTML().s;

View File

@ -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', 'haskell', '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', 'go'];
var supportCharts = ['sequence', 'flow', 'graphviz', 'mermaid'];
var supportHeaders = [
{

File diff suppressed because one or more lines are too long

View File

@ -56,6 +56,7 @@ mode/r/r.js \
mode/dockerfile/dockerfile.js \
mode/tiddlywiki/tiddlywiki.js \
mode/mediawiki/mediawiki.js \
mode/go/go.js \
keymap/emacs.js \
keymap/sublime.js \
keymap/vim.js