Update to support typescript and jsx syntax highlighting

This commit is contained in:
Wu Cheng-Han 2016-11-28 18:34:08 +08:00
parent b773c8a7d7
commit de2067f7e8
2 changed files with 4 additions and 2 deletions

View file

@ -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])

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', '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 = [
{