Skip to content

Commit 1a9df22

Browse files
committed
Add autocomplete for highlight.js languages into codemirror
Right now we support code highlighting for rust, but it doesn't appear in autocomplete of codemirror, because codemirror is not aware of it. This patch lets highlightjs simply tell codemirror, what it supports and adds this to the autocomplete list. Signed-off-by: Sheogorath <[email protected]>
1 parent c7478c1 commit 1a9df22

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

public/js/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import toMarkdown from 'to-markdown'
1717
import { saveAs } from 'file-saver'
1818
import randomColor from 'randomcolor'
1919
import store from 'store'
20+
import hljs from 'highlight.js'
2021

2122
import _ from 'lodash'
2223

@@ -92,7 +93,7 @@ var cursorMenuThrottle = 50
9293
var cursorActivityDebounce = 50
9394
var cursorAnimatePeriod = 100
9495
var supportContainers = ['success', 'info', 'warning', 'danger']
95-
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', 'gherkin']
96+
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', 'gherkin'].concat(hljs.listLanguages())
9697
var supportCharts = ['sequence', 'flow', 'graphviz', 'mermaid', 'abc']
9798
var supportHeaders = [
9899
{

0 commit comments

Comments
 (0)