summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorWu Cheng-Han2016-11-28 18:34:08 +0800
committerWu Cheng-Han2016-11-28 18:34:08 +0800
commitde2067f7e898f3557323782d28e8f7530ffb539f (patch)
tree75f2398e9bc467bf50f617a1bf6f7fa6b0474af1 /public
parentb773c8a7d767f66da1c76e8db8adc3a858270af9 (diff)
Update to support typescript and jsx syntax highlighting
Diffstat (limited to '')
-rw-r--r--public/js/extra.js4
-rw-r--r--public/js/index.js2
2 files changed, 4 insertions, 2 deletions
diff --git a/public/js/extra.js b/public/js/extra.js
index 20ce1728..3fe1084e 100644
--- a/public/js/extra.js
+++ b/public/js/extra.js
@@ -4,6 +4,8 @@ var Prism = require('prismjs');
require('prismjs/components/prism-wiki');
require('prismjs/components/prism-haskell');
require('prismjs/components/prism-go');
+require('prismjs/components/prism-typescript');
+require('prismjs/components/prism-jsx');
var hljs = require('highlight.js');
var PDFObject = require('pdfobject');
var S = require('string');
@@ -475,7 +477,7 @@ function finishView(view) {
var result = {
value: code
};
- } else if (reallang == "haskell" || reallang == "go") {
+ } else if (reallang == "haskell" || reallang == "go" || reallang == "typescript" || reallang == "jsx") {
code = S(code).unescapeHTML().s;
var result = {
value: Prism.highlight(code, Prism.languages[reallang])
diff --git a/public/js/index.js b/public/js/index.js
index 341db69e..c70f013b 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', 'haskell', 'coffeescript', 'yaml', 'pug', 'lua', 'cmake', 'nginx', 'perl', 'sass', 'r', 'dockerfile', 'tiddlywiki', 'mediawiki', 'go'];
+var supportCodeModes = ['javascript', 'typescript', 'jsx', '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 = [
{