Merge pull request #4930 from BookStackApp/split_md_js

JS Build: Split markdown to own file, updated packages
This commit is contained in:
Dan Brown 2024-04-08 14:46:06 +01:00 committed by GitHub
commit dde1f27882
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 420 additions and 336 deletions

View File

@ -13,6 +13,7 @@ const entryPoints = {
app: path.join(__dirname, '../../resources/js/app.js'),
code: path.join(__dirname, '../../resources/js/code/index.mjs'),
'legacy-modes': path.join(__dirname, '../../resources/js/code/legacy-modes.mjs'),
markdown: path.join(__dirname, '../../resources/js/markdown/index.mjs'),
};
// Locate our output directory

727
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -25,7 +25,6 @@
"eslint-plugin-import": "^2.29.0",
"livereload": "^0.9.3",
"npm-run-all": "^4.1.5",
"punycode": "^2.3.1",
"sass": "^1.69.5"
},
"dependencies": {
@ -47,7 +46,7 @@
"@ssddanbrown/codemirror-lang-twig": "^1.0.0",
"codemirror": "^6.0.1",
"idb-keyval": "^6.2.1",
"markdown-it": "^13.0.2",
"markdown-it": "^14.1.0",
"markdown-it-task-lists": "^2.1.1",
"snabbdom": "^3.5.1",
"sortablejs": "^1.15.1"

View File

@ -1,5 +1,4 @@
import {Component} from './component';
import {init as initEditor} from '../markdown/editor';
export class MarkdownEditor extends Component {
@ -20,7 +19,8 @@ export class MarkdownEditor extends Component {
const settingInputs = settingContainer.querySelectorAll('input[type="checkbox"]');
this.editor = null;
initEditor({
window.importVersioned('markdown').then(markdown => {
return markdown.init({
pageId: this.pageId,
container: this.elem,
displayEl: this.display,
@ -31,6 +31,7 @@ export class MarkdownEditor extends Component {
serverUploadLimit: this.serverUploadLimitText,
imageUploadError: this.imageUploadErrorText,
},
});
}).then(editor => {
this.editor = editor;
this.setupListeners();