Merge branch 'master' into renovate/master-formidable-2.x

This commit is contained in:
Yannick Bungers 2021-12-02 19:59:39 +01:00 committed by GitHub
commit 386c08a339
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 527 additions and 216 deletions

View file

@ -3,7 +3,6 @@
const Router = require('express').Router
const formidable = require('formidable')
const path = require('path')
const FileType = require('file-type')
const fs = require('fs')
const os = require('os')
const rimraf = require('rimraf')
@ -17,7 +16,8 @@ const imageRouter = (module.exports = Router())
async function checkUploadType (filePath) {
const extension = path.extname(filePath).toLowerCase()
let typeFromMagic = await FileType.fromFile(filePath)
const FileType = await import('file-type')
let typeFromMagic = await FileType.fileTypeFromFile(filePath)
if (extension === '.svg' && (typeFromMagic === undefined || typeFromMagic.mime === 'application/xml')) {
const fileContent = fs.readFileSync(filePath)
if (isSvg(fileContent)) {

View file

@ -37,8 +37,8 @@
"ejs": "^3.0.0",
"express": ">=4.14",
"express-session": "^1.14.2",
"file-type": "^16.1.0",
"formidable": "^2.0.0",
"file-type": "^17.0.0",
"graceful-fs": "^4.1.11",
"helmet": "^4.5.0",
"i18n": "^0.13.0",
@ -70,7 +70,7 @@
"morgan": "^1.7.0",
"mysql2": "^2.0.0",
"node-fetch": "^2.6.1",
"passport": "^0.4.0",
"passport": "^0.5.0",
"passport-dropbox-oauth2": "^1.1.0",
"passport-facebook": "^3.0.0",
"passport-github": "^1.1.0",
@ -110,7 +110,7 @@
"**/request": "^2.88.0"
},
"engines": {
"node": "12.x || 14.x || 16.x"
"node": "^12.20.0 || ^14.13.1 || 16.x"
},
"bugs": "https://github.com/hedgedoc/hedgedoc/issues",
"keywords": [
@ -153,9 +153,9 @@
"copy-webpack-plugin": "6.4.1",
"css-loader": "5.2.7",
"emojify.js": "1.1.0",
"esbuild-loader": "2.15.1",
"esbuild-loader": "2.16.0",
"escape-html": "1.0.3",
"eslint": "7.32.0",
"eslint": "8.3.0",
"eslint-config-standard": "16.0.3",
"eslint-plugin-import": "2.25.3",
"eslint-plugin-node": "11.1.0",
@ -165,7 +165,7 @@
"expose-loader": "1.0.3",
"file-loader": "6.2.0",
"file-saver": "2.0.5",
"flowchart.js": "1.15.0",
"flowchart.js": "1.17.0",
"fork-awesome": "1.2.0",
"gist-embed": "2.6.0",
"highlight.js": "10.7.3",
@ -174,7 +174,7 @@
"ionicons": "2.0.1",
"jquery": "3.6.0",
"jquery-mousewheel": "3.1.13",
"jquery-ui": "1.12.1",
"jquery-ui": "1.13.0",
"js-cookie": "3.0.1",
"js-sequence-diagrams": "git+https://github.com/hedgedoc/js-sequence-diagrams.git",
"js-yaml": "3.14.1",
@ -184,15 +184,15 @@
"less-loader": "7.3.0",
"list.js": "2.3.1",
"mathjax": "2.7.9",
"mermaid": "8.12.1",
"mermaid": "8.13.4",
"mini-css-extract-plugin": "1.6.2",
"mocha": "9.1.3",
"mock-require": "3.0.3",
"optimize-css-assets-webpack-plugin": "6.0.1",
"prismjs": "1.24.1",
"prismjs": "1.25.0",
"raphael": "2.3.0",
"remark-cli": "10.0.1",
"remark-preset-lint-markdown-style-guide": "5.0.1",
"remark-preset-lint-markdown-style-guide": "5.1.1",
"reveal.js": "3.9.2",
"select2": "3.5.2-browserify",
"socket.io-client": "2.4.0",
@ -204,7 +204,7 @@
"visibilityjs": "2.0.2",
"viz.js": "1.8.2",
"webpack": "4.46.0",
"webpack-cli": "4.8.0",
"webpack-cli": "4.9.1",
"webpack-merge": "5.8.0",
"wurl": "2.5.4"
},

View file

@ -387,7 +387,7 @@ export function finishView (view) {
const $ele = $(value).closest('pre')
require.ensure([], function (require) {
try {
const mermaid = require('mermaid')
const mermaid = require('mermaid').default
mermaid.startOnLoad = false
mermaid.mermaidAPI.parse($value.text())
$ele.addClass('mermaid')

715
yarn.lock

File diff suppressed because it is too large Load diff