mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-13 15:29:51 +08:00
Made the "Custom HTML Head Content" setting a highlighted code editor
This commit is contained in:
@ -242,6 +242,21 @@ export function popupEditor(elem, modeSuggestion) {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an inline editor to replace the given textarea.
|
||||
* @param {HTMLTextAreaElement} textArea
|
||||
* @param {String} mode
|
||||
* @returns {CodeMirror3}
|
||||
*/
|
||||
export function inlineEditor(textArea, mode) {
|
||||
return CodeMirror.fromTextArea(textArea, {
|
||||
mode: getMode(mode, textArea.value),
|
||||
lineNumbers: true,
|
||||
lineWrapping: false,
|
||||
theme: getTheme(),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the mode of a codemirror instance.
|
||||
* @param cmInstance
|
||||
|
Reference in New Issue
Block a user