mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-09 12:36:37 +08:00
Ran eslint fix on existing codebase
Had to do some manual fixing of the app.js file due to misplaced comments
This commit is contained in:
@ -1,20 +1,19 @@
|
||||
import {StreamLanguage} from "@codemirror/language"
|
||||
import {StreamLanguage} from '@codemirror/language';
|
||||
|
||||
import {css} from '@codemirror/lang-css';
|
||||
import {json} from '@codemirror/lang-json';
|
||||
import {javascript} from '@codemirror/lang-javascript';
|
||||
import {html} from "@codemirror/lang-html";
|
||||
import {html} from '@codemirror/lang-html';
|
||||
import {markdown} from '@codemirror/lang-markdown';
|
||||
import {php} from '@codemirror/lang-php';
|
||||
import {twig} from "@ssddanbrown/codemirror-lang-twig";
|
||||
import {xml} from "@codemirror/lang-xml";
|
||||
import {twig} from '@ssddanbrown/codemirror-lang-twig';
|
||||
import {xml} from '@codemirror/lang-xml';
|
||||
|
||||
const legacyLoad = async (mode) => {
|
||||
const legacyLoad = async mode => {
|
||||
const modes = await window.importVersioned('legacy-modes');
|
||||
return StreamLanguage.define(modes[mode]);
|
||||
};
|
||||
|
||||
|
||||
// Mapping of possible languages or formats from user input to their codemirror modes.
|
||||
// Value can be a mode string or a function that will receive the code content & return the mode string.
|
||||
// The function option is used in the event the exact mode could be dynamic depending on the code.
|
||||
@ -58,7 +57,7 @@ const modeMap = {
|
||||
pascal: () => legacyLoad('pascal'),
|
||||
perl: () => legacyLoad('perl'),
|
||||
pgsql: () => legacyLoad('pgSQL'),
|
||||
php: async (code) => {
|
||||
php: async code => {
|
||||
const hasTags = code.includes('<?php');
|
||||
return php({plain: !hasTags});
|
||||
},
|
||||
@ -113,4 +112,4 @@ export function getLanguageExtension(langSuggestion, content) {
|
||||
}
|
||||
|
||||
return language(content);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user