mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-23 10:16:32 -05:00
added js as an extra highlighted language (#646)
This commit is contained in:
parent
9f7a106834
commit
b094fe1de6
3 changed files with 4 additions and 2 deletions
|
@ -15,7 +15,7 @@ const codeBlockHint = (editor: Editor): Promise< Hints| null > => {
|
||||||
}
|
}
|
||||||
const term = searchResult[1]
|
const term = searchResult[1]
|
||||||
if (allSupportedLanguages.length === 0) {
|
if (allSupportedLanguages.length === 0) {
|
||||||
allSupportedLanguages = hljs.listLanguages().concat('csv', 'flow', 'html')
|
allSupportedLanguages = hljs.listLanguages().concat('csv', 'flow', 'html', 'js', 'markmap', 'abc', 'graphviz', 'mermaid', 'vega-lite')
|
||||||
}
|
}
|
||||||
const suggestions = search(term, allSupportedLanguages)
|
const suggestions = search(term, allSupportedLanguages)
|
||||||
const cursor = editor.getCursor()
|
const cursor = editor.getCursor()
|
||||||
|
|
|
@ -230,7 +230,7 @@ https://asciinema.org/a/117928
|
||||||
{%pdf https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf %}
|
{%pdf https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf %}
|
||||||
|
|
||||||
## Code highlighting
|
## Code highlighting
|
||||||
\`\`\`javascript=
|
\`\`\`js=
|
||||||
var s = "JavaScript syntax highlighting";
|
var s = "JavaScript syntax highlighting";
|
||||||
alert(s);
|
alert(s);
|
||||||
function $initHighlight(block, cls) {
|
function $initHighlight(block, cls) {
|
||||||
|
|
|
@ -24,6 +24,8 @@ const correctLanguage = (language: string | undefined): string | undefined => {
|
||||||
switch (language) {
|
switch (language) {
|
||||||
case 'html':
|
case 'html':
|
||||||
return 'xml'
|
return 'xml'
|
||||||
|
case 'js':
|
||||||
|
return 'javascript'
|
||||||
default:
|
default:
|
||||||
return language
|
return language
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue