From b24f715221e646ce58ff15196156322384108cbb Mon Sep 17 00:00:00 2001 From: wanghao Date: Sun, 27 Aug 2023 23:15:03 +0800 Subject: [PATCH 1/4] =?UTF-8?q?markdown=E6=94=AF=E6=8C=81=E5=A4=9A?= =?UTF-8?q?=E8=A1=8C=E5=85=AC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aurora-vue/aurora-admin/package-lock.json | 137 ++++++++++++++ aurora-vue/aurora-admin/package.json | 2 + aurora-vue/aurora-admin/src/main.js | 2 + aurora-vue/aurora-blog/package-lock.json | 188 +++++++++++++++++++ aurora-vue/aurora-blog/package.json | 1 + aurora-vue/aurora-blog/src/utils/markdown.ts | 3 +- 6 files changed, 332 insertions(+), 1 deletion(-) diff --git a/aurora-vue/aurora-admin/package-lock.json b/aurora-vue/aurora-admin/package-lock.json index 2cf8c58..c425015 100644 --- a/aurora-vue/aurora-admin/package-lock.json +++ b/aurora-vue/aurora-admin/package-lock.json @@ -8,11 +8,13 @@ "name": "aurora-admin", "version": "0.1.0", "dependencies": { + "@iktakahiro/markdown-it-katex": "^4.0.1", "axios": "^0.27.2", "core-js": "^3.8.3", "dayjs": "^1.11.4", "element-ui": "^2.15.8", "image-conversion": "^2.1.1", + "markdown-it": "^13.0.1", "mavon-editor": "^2.9.0", "nprogress": "^0.2.0", "path": "^0.12.7", @@ -1715,6 +1717,14 @@ "@hapi/hoek": "^9.0.0" } }, + "node_modules/@iktakahiro/markdown-it-katex": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/@iktakahiro/markdown-it-katex/-/markdown-it-katex-4.0.1.tgz", + "integrity": "sha512-kGFooO7fIOgY34PSG8ZNVsUlKhhNoqhzW2kq94TNGa8COzh73PO4KsEoPOsQVG1mEAe8tg7GqG0FoVao0aMHaw==", + "dependencies": { + "katex": "^0.12.0" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.1.1", "resolved": "https://registry.npmmirror.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", @@ -3077,6 +3087,11 @@ "integrity": "sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==", "dev": true }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, "node_modules/array-flatten": { "version": "2.1.2", "resolved": "https://registry.npmmirror.com/array-flatten/-/array-flatten-2.1.2.tgz", @@ -5938,6 +5953,22 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/katex": { + "version": "0.12.0", + "resolved": "https://registry.npmmirror.com/katex/-/katex-0.12.0.tgz", + "integrity": "sha512-y+8btoc/CK70XqcHqjxiGWBOeIL8upbS0peTPXTvgrh21n1RiWWcIpSWM+4uXq+IAgNh9YYQWdc7LVDPDAEEAg==", + "dependencies": { + "commander": "^2.19.0" + }, + "bin": { + "katex": "cli.js" + } + }, + "node_modules/katex/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmmirror.com/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmmirror.com/kind-of/-/kind-of-6.0.3.tgz", @@ -5990,6 +6021,14 @@ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true }, + "node_modules/linkify-it": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/linkify-it/-/linkify-it-4.0.1.tgz", + "integrity": "sha512-C7bfi1UZmoj8+PQx22XyeXCuBlokoyWQL5pWSP+EI6nzRylyThouddufc2c1NDIcP9k5agmN9fLpA7VNJfIiqw==", + "dependencies": { + "uc.micro": "^1.0.1" + } + }, "node_modules/loader-runner": { "version": "4.3.0", "resolved": "https://registry.npmmirror.com/loader-runner/-/loader-runner-4.3.0.tgz", @@ -6304,6 +6343,29 @@ "node": ">=8" } }, + "node_modules/markdown-it": { + "version": "13.0.1", + "resolved": "https://registry.npmmirror.com/markdown-it/-/markdown-it-13.0.1.tgz", + "integrity": "sha512-lTlxriVoy2criHP0JKRhO2VDG9c2ypWCsT237eDiLqi09rmbKoUetyGHq2uOIRoRS//kfoJckS0eUzzkDR+k2Q==", + "dependencies": { + "argparse": "^2.0.1", + "entities": "~3.0.1", + "linkify-it": "^4.0.1", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + }, + "bin": { + "markdown-it": "bin/markdown-it.js" + } + }, + "node_modules/markdown-it/node_modules/entities": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/entities/-/entities-3.0.1.tgz", + "integrity": "sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==", + "engines": { + "node": ">=0.12" + } + }, "node_modules/mavon-editor": { "version": "2.9.0", "resolved": "https://registry.npmmirror.com/mavon-editor/-/mavon-editor-2.9.0.tgz", @@ -6330,6 +6392,11 @@ "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", "dev": true }, + "node_modules/mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==" + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmmirror.com/media-typer/-/media-typer-0.3.0.tgz", @@ -9068,6 +9135,11 @@ "node": ">= 0.6" } }, + "node_modules/uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmmirror.com/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" + }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmmirror.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", @@ -11232,6 +11304,14 @@ "@hapi/hoek": "^9.0.0" } }, + "@iktakahiro/markdown-it-katex": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/@iktakahiro/markdown-it-katex/-/markdown-it-katex-4.0.1.tgz", + "integrity": "sha512-kGFooO7fIOgY34PSG8ZNVsUlKhhNoqhzW2kq94TNGa8COzh73PO4KsEoPOsQVG1mEAe8tg7GqG0FoVao0aMHaw==", + "requires": { + "katex": "^0.12.0" + } + }, "@jridgewell/gen-mapping": { "version": "0.1.1", "resolved": "https://registry.npmmirror.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", @@ -12377,6 +12457,11 @@ "integrity": "sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==", "dev": true }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, "array-flatten": { "version": "2.1.2", "resolved": "https://registry.npmmirror.com/array-flatten/-/array-flatten-2.1.2.tgz", @@ -14692,6 +14777,21 @@ "universalify": "^2.0.0" } }, + "katex": { + "version": "0.12.0", + "resolved": "https://registry.npmmirror.com/katex/-/katex-0.12.0.tgz", + "integrity": "sha512-y+8btoc/CK70XqcHqjxiGWBOeIL8upbS0peTPXTvgrh21n1RiWWcIpSWM+4uXq+IAgNh9YYQWdc7LVDPDAEEAg==", + "requires": { + "commander": "^2.19.0" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmmirror.com/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + } + } + }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmmirror.com/kind-of/-/kind-of-6.0.3.tgz", @@ -14735,6 +14835,14 @@ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true }, + "linkify-it": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/linkify-it/-/linkify-it-4.0.1.tgz", + "integrity": "sha512-C7bfi1UZmoj8+PQx22XyeXCuBlokoyWQL5pWSP+EI6nzRylyThouddufc2c1NDIcP9k5agmN9fLpA7VNJfIiqw==", + "requires": { + "uc.micro": "^1.0.1" + } + }, "loader-runner": { "version": "4.3.0", "resolved": "https://registry.npmmirror.com/loader-runner/-/loader-runner-4.3.0.tgz", @@ -14989,6 +15097,25 @@ "semver": "^6.0.0" } }, + "markdown-it": { + "version": "13.0.1", + "resolved": "https://registry.npmmirror.com/markdown-it/-/markdown-it-13.0.1.tgz", + "integrity": "sha512-lTlxriVoy2criHP0JKRhO2VDG9c2ypWCsT237eDiLqi09rmbKoUetyGHq2uOIRoRS//kfoJckS0eUzzkDR+k2Q==", + "requires": { + "argparse": "^2.0.1", + "entities": "~3.0.1", + "linkify-it": "^4.0.1", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + }, + "dependencies": { + "entities": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/entities/-/entities-3.0.1.tgz", + "integrity": "sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==" + } + } + }, "mavon-editor": { "version": "2.9.0", "resolved": "https://registry.npmmirror.com/mavon-editor/-/mavon-editor-2.9.0.tgz", @@ -15012,6 +15139,11 @@ "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", "dev": true }, + "mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==" + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmmirror.com/media-typer/-/media-typer-0.3.0.tgz", @@ -17150,6 +17282,11 @@ "mime-types": "~2.1.24" } }, + "uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmmirror.com/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" + }, "unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmmirror.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", diff --git a/aurora-vue/aurora-admin/package.json b/aurora-vue/aurora-admin/package.json index 6d93167..96a7df6 100644 --- a/aurora-vue/aurora-admin/package.json +++ b/aurora-vue/aurora-admin/package.json @@ -8,11 +8,13 @@ "deploy": "node deploy.js" }, "dependencies": { + "@iktakahiro/markdown-it-katex": "^4.0.1", "axios": "^0.27.2", "core-js": "^3.8.3", "dayjs": "^1.11.4", "element-ui": "^2.15.8", "image-conversion": "^2.1.1", + "markdown-it": "^13.0.1", "mavon-editor": "^2.9.0", "nprogress": "^0.2.0", "path": "^0.12.7", diff --git a/aurora-vue/aurora-admin/src/main.js b/aurora-vue/aurora-admin/src/main.js index a9caf5f..6283394 100644 --- a/aurora-vue/aurora-admin/src/main.js +++ b/aurora-vue/aurora-admin/src/main.js @@ -24,6 +24,7 @@ import 'mavon-editor/dist/css/index.css' import VueCalendarHeatmap from 'vue-calendar-heatmap' import tagCloud from './components/tag-cloud' import dayjs from 'dayjs' +import Md_Katex from '@iktakahiro/markdown-it-katex' Vue.config.productionTip = false Vue.prototype.config = config @@ -34,6 +35,7 @@ Vue.use(VueCalendarHeatmap) Vue.use(VueAxios, axios) Vue.component('v-chart', ECharts) Vue.prototype.$moment = dayjs +mavonEditor.markdownIt.set({}).use(Md_Katex); Vue.filter('date', function (value, formatStr = 'YYYY-MM-DD') { return dayjs(value).format(formatStr) diff --git a/aurora-vue/aurora-blog/package-lock.json b/aurora-vue/aurora-blog/package-lock.json index 134e319..1c1d697 100644 --- a/aurora-vue/aurora-blog/package-lock.json +++ b/aurora-vue/aurora-blog/package-lock.json @@ -8,13 +8,22 @@ "name": "aurora-blog", "version": "0.1.0", "dependencies": { + "@iktakahiro/markdown-it-katex": "^4.0.1", "axios": "^0.27.2", "core-js": "^3.8.3", "element-plus": "^2.2.9", "js-cookie": "^3.0.1", "markdown-it": "^13.0.1", + "markdown-it-abbr": "^1.0.4", + "markdown-it-container": "^3.0.0", "markdown-it-emoji": "^2.0.2", + "markdown-it-footnote": "^3.0.3", + "markdown-it-ins": "^3.0.1", "markdown-it-katex-external": "^1.0.0", + "markdown-it-mark": "^3.0.1", + "markdown-it-sub": "^1.0.0", + "markdown-it-sup": "^1.0.0", + "mavon-editor": "^3.0.1", "mitt": "^3.0.0", "normalize.css": "^8.0.1", "nprogress": "^0.2.0", @@ -1797,6 +1806,14 @@ "@hapi/hoek": "^9.0.0" } }, + "node_modules/@iktakahiro/markdown-it-katex": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/@iktakahiro/markdown-it-katex/-/markdown-it-katex-4.0.1.tgz", + "integrity": "sha512-kGFooO7fIOgY34PSG8ZNVsUlKhhNoqhzW2kq94TNGa8COzh73PO4KsEoPOsQVG1mEAe8tg7GqG0FoVao0aMHaw==", + "dependencies": { + "katex": "^0.12.0" + } + }, "node_modules/@intlify/core-base": { "version": "9.1.10", "resolved": "https://registry.npmmirror.com/@intlify/core-base/-/core-base-9.1.10.tgz", @@ -6246,6 +6263,11 @@ "node": ">=4" } }, + "node_modules/cssfilter": { + "version": "0.0.10", + "resolved": "https://registry.npmmirror.com/cssfilter/-/cssfilter-0.0.10.tgz", + "integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==" + }, "node_modules/csso": { "version": "4.2.0", "resolved": "https://registry.npmmirror.com/csso/-/csso-4.2.0.tgz", @@ -8474,6 +8496,22 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/katex": { + "version": "0.12.0", + "resolved": "https://registry.npmmirror.com/katex/-/katex-0.12.0.tgz", + "integrity": "sha512-y+8btoc/CK70XqcHqjxiGWBOeIL8upbS0peTPXTvgrh21n1RiWWcIpSWM+4uXq+IAgNh9YYQWdc7LVDPDAEEAg==", + "dependencies": { + "commander": "^2.19.0" + }, + "bin": { + "katex": "cli.js" + } + }, + "node_modules/katex/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmmirror.com/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmmirror.com/kind-of/-/kind-of-6.0.3.tgz", @@ -8910,16 +8948,51 @@ "markdown-it": "bin/markdown-it.js" } }, + "node_modules/markdown-it-abbr": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/markdown-it-abbr/-/markdown-it-abbr-1.0.4.tgz", + "integrity": "sha512-ZeA4Z4SaBbYysZap5iZcxKmlPL6bYA8grqhzJIHB1ikn7njnzaP8uwbtuXc4YXD5LicI4/2Xmc0VwmSiFV04gg==" + }, + "node_modules/markdown-it-container": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/markdown-it-container/-/markdown-it-container-3.0.0.tgz", + "integrity": "sha512-y6oKTq4BB9OQuY/KLfk/O3ysFhB3IMYoIWhGJEidXt1NQFocFK2sA2t0NYZAMyMShAGL6x5OPIbrmXPIqaN9rw==" + }, "node_modules/markdown-it-emoji": { "version": "2.0.2", "resolved": "https://registry.npmmirror.com/markdown-it-emoji/-/markdown-it-emoji-2.0.2.tgz", "integrity": "sha512-zLftSaNrKuYl0kR5zm4gxXjHaOI3FAOEaloKmRA5hijmJZvSjmxcokOLlzycb/HXlUFWzXqpIEoyEMCE4i9MvQ==" }, + "node_modules/markdown-it-footnote": { + "version": "3.0.3", + "resolved": "https://registry.npmmirror.com/markdown-it-footnote/-/markdown-it-footnote-3.0.3.tgz", + "integrity": "sha512-YZMSuCGVZAjzKMn+xqIco9d1cLGxbELHZ9do/TSYVzraooV8ypsppKNmUJ0fVH5ljkCInQAtFpm8Rb3eXSrt5w==" + }, + "node_modules/markdown-it-ins": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/markdown-it-ins/-/markdown-it-ins-3.0.1.tgz", + "integrity": "sha512-32SSfZqSzqyAmmQ4SHvhxbFqSzPDqsZgMHDwxqPzp+v+t8RsmqsBZRG+RfRQskJko9PfKC2/oxyOs4Yg/CfiRw==" + }, "node_modules/markdown-it-katex-external": { "version": "1.0.0", "resolved": "https://registry.npmmirror.com/markdown-it-katex-external/-/markdown-it-katex-external-1.0.0.tgz", "integrity": "sha512-vYZCxFH3FW9ViL/00FrcxxR/l8NiX2yXDtFA7hUEntzs+UII8TfdpjGCYRLUrgetHqZoJLMYO0Fs+u0H24nlWQ==" }, + "node_modules/markdown-it-mark": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/markdown-it-mark/-/markdown-it-mark-3.0.1.tgz", + "integrity": "sha512-HyxjAu6BRsdt6Xcv6TKVQnkz/E70TdGXEFHRYBGLncRE9lBFwDNLVtFojKxjJWgJ+5XxUwLaHXy+2sGBbDn+4A==" + }, + "node_modules/markdown-it-sub": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/markdown-it-sub/-/markdown-it-sub-1.0.0.tgz", + "integrity": "sha512-z2Rm/LzEE1wzwTSDrI+FlPEveAAbgdAdPhdWarq/ZGJrGW/uCQbKAnhoCsE4hAbc3SEym26+W2z/VQB0cQiA9Q==" + }, + "node_modules/markdown-it-sup": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/markdown-it-sup/-/markdown-it-sup-1.0.0.tgz", + "integrity": "sha512-E32m0nV9iyhRR7CrhnzL5msqic7rL1juWre6TQNxsnApg7Uf+F97JOKxUijg5YwXz86lZ0mqfOnutoryyNdntQ==" + }, "node_modules/markdown-it/node_modules/entities": { "version": "3.0.1", "resolved": "https://registry.npmmirror.com/entities/-/entities-3.0.1.tgz", @@ -8928,6 +9001,14 @@ "node": ">=0.12" } }, + "node_modules/mavon-editor": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/mavon-editor/-/mavon-editor-3.0.1.tgz", + "integrity": "sha512-973cYCwv+AB+fcecsU6Ua6UXATxDMaY0Q7QzKQ/GmRW1sg+3DolZDnCGXth7XHDgrmqKTO57N42fVYujt0wfFw==", + "dependencies": { + "xss": "^1.0.10" + } + }, "node_modules/mdn-data": { "version": "2.0.14", "resolved": "https://registry.npmmirror.com/mdn-data/-/mdn-data-2.0.14.tgz", @@ -14050,6 +14131,26 @@ } } }, + "node_modules/xss": { + "version": "1.0.14", + "resolved": "https://registry.npmmirror.com/xss/-/xss-1.0.14.tgz", + "integrity": "sha512-og7TEJhXvn1a7kzZGQ7ETjdQVS2UfZyTlsEdDOqvQF7GoxNfY+0YLCzBy1kPdsDDx4QuNAonQPddpsn6Xl/7sw==", + "dependencies": { + "commander": "^2.20.3", + "cssfilter": "0.0.10" + }, + "bin": { + "xss": "bin/xss" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/xss/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmmirror.com/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmmirror.com/xtend/-/xtend-4.0.2.tgz", @@ -15338,6 +15439,14 @@ "@hapi/hoek": "^9.0.0" } }, + "@iktakahiro/markdown-it-katex": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/@iktakahiro/markdown-it-katex/-/markdown-it-katex-4.0.1.tgz", + "integrity": "sha512-kGFooO7fIOgY34PSG8ZNVsUlKhhNoqhzW2kq94TNGa8COzh73PO4KsEoPOsQVG1mEAe8tg7GqG0FoVao0aMHaw==", + "requires": { + "katex": "^0.12.0" + } + }, "@intlify/core-base": { "version": "9.1.10", "resolved": "https://registry.npmmirror.com/@intlify/core-base/-/core-base-9.1.10.tgz", @@ -18778,6 +18887,11 @@ "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", "dev": true }, + "cssfilter": { + "version": "0.0.10", + "resolved": "https://registry.npmmirror.com/cssfilter/-/cssfilter-0.0.10.tgz", + "integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==" + }, "csso": { "version": "4.2.0", "resolved": "https://registry.npmmirror.com/csso/-/csso-4.2.0.tgz", @@ -20553,6 +20667,21 @@ "universalify": "^2.0.0" } }, + "katex": { + "version": "0.12.0", + "resolved": "https://registry.npmmirror.com/katex/-/katex-0.12.0.tgz", + "integrity": "sha512-y+8btoc/CK70XqcHqjxiGWBOeIL8upbS0peTPXTvgrh21n1RiWWcIpSWM+4uXq+IAgNh9YYQWdc7LVDPDAEEAg==", + "requires": { + "commander": "^2.19.0" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmmirror.com/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + } + } + }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmmirror.com/kind-of/-/kind-of-6.0.3.tgz", @@ -20914,16 +21043,59 @@ } } }, + "markdown-it-abbr": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/markdown-it-abbr/-/markdown-it-abbr-1.0.4.tgz", + "integrity": "sha512-ZeA4Z4SaBbYysZap5iZcxKmlPL6bYA8grqhzJIHB1ikn7njnzaP8uwbtuXc4YXD5LicI4/2Xmc0VwmSiFV04gg==" + }, + "markdown-it-container": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/markdown-it-container/-/markdown-it-container-3.0.0.tgz", + "integrity": "sha512-y6oKTq4BB9OQuY/KLfk/O3ysFhB3IMYoIWhGJEidXt1NQFocFK2sA2t0NYZAMyMShAGL6x5OPIbrmXPIqaN9rw==" + }, "markdown-it-emoji": { "version": "2.0.2", "resolved": "https://registry.npmmirror.com/markdown-it-emoji/-/markdown-it-emoji-2.0.2.tgz", "integrity": "sha512-zLftSaNrKuYl0kR5zm4gxXjHaOI3FAOEaloKmRA5hijmJZvSjmxcokOLlzycb/HXlUFWzXqpIEoyEMCE4i9MvQ==" }, + "markdown-it-footnote": { + "version": "3.0.3", + "resolved": "https://registry.npmmirror.com/markdown-it-footnote/-/markdown-it-footnote-3.0.3.tgz", + "integrity": "sha512-YZMSuCGVZAjzKMn+xqIco9d1cLGxbELHZ9do/TSYVzraooV8ypsppKNmUJ0fVH5ljkCInQAtFpm8Rb3eXSrt5w==" + }, + "markdown-it-ins": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/markdown-it-ins/-/markdown-it-ins-3.0.1.tgz", + "integrity": "sha512-32SSfZqSzqyAmmQ4SHvhxbFqSzPDqsZgMHDwxqPzp+v+t8RsmqsBZRG+RfRQskJko9PfKC2/oxyOs4Yg/CfiRw==" + }, "markdown-it-katex-external": { "version": "1.0.0", "resolved": "https://registry.npmmirror.com/markdown-it-katex-external/-/markdown-it-katex-external-1.0.0.tgz", "integrity": "sha512-vYZCxFH3FW9ViL/00FrcxxR/l8NiX2yXDtFA7hUEntzs+UII8TfdpjGCYRLUrgetHqZoJLMYO0Fs+u0H24nlWQ==" }, + "markdown-it-mark": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/markdown-it-mark/-/markdown-it-mark-3.0.1.tgz", + "integrity": "sha512-HyxjAu6BRsdt6Xcv6TKVQnkz/E70TdGXEFHRYBGLncRE9lBFwDNLVtFojKxjJWgJ+5XxUwLaHXy+2sGBbDn+4A==" + }, + "markdown-it-sub": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/markdown-it-sub/-/markdown-it-sub-1.0.0.tgz", + "integrity": "sha512-z2Rm/LzEE1wzwTSDrI+FlPEveAAbgdAdPhdWarq/ZGJrGW/uCQbKAnhoCsE4hAbc3SEym26+W2z/VQB0cQiA9Q==" + }, + "markdown-it-sup": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/markdown-it-sup/-/markdown-it-sup-1.0.0.tgz", + "integrity": "sha512-E32m0nV9iyhRR7CrhnzL5msqic7rL1juWre6TQNxsnApg7Uf+F97JOKxUijg5YwXz86lZ0mqfOnutoryyNdntQ==" + }, + "mavon-editor": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/mavon-editor/-/mavon-editor-3.0.1.tgz", + "integrity": "sha512-973cYCwv+AB+fcecsU6Ua6UXATxDMaY0Q7QzKQ/GmRW1sg+3DolZDnCGXth7XHDgrmqKTO57N42fVYujt0wfFw==", + "requires": { + "xss": "^1.0.10" + } + }, "mdn-data": { "version": "2.0.14", "resolved": "https://registry.npmmirror.com/mdn-data/-/mdn-data-2.0.14.tgz", @@ -25058,6 +25230,22 @@ "dev": true, "requires": {} }, + "xss": { + "version": "1.0.14", + "resolved": "https://registry.npmmirror.com/xss/-/xss-1.0.14.tgz", + "integrity": "sha512-og7TEJhXvn1a7kzZGQ7ETjdQVS2UfZyTlsEdDOqvQF7GoxNfY+0YLCzBy1kPdsDDx4QuNAonQPddpsn6Xl/7sw==", + "requires": { + "commander": "^2.20.3", + "cssfilter": "0.0.10" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmmirror.com/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + } + } + }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmmirror.com/xtend/-/xtend-4.0.2.tgz", diff --git a/aurora-vue/aurora-blog/package.json b/aurora-vue/aurora-blog/package.json index efe17a1..b5db7a9 100644 --- a/aurora-vue/aurora-blog/package.json +++ b/aurora-vue/aurora-blog/package.json @@ -8,6 +8,7 @@ "deploy": "node deploy.js" }, "dependencies": { + "@iktakahiro/markdown-it-katex": "^4.0.1", "axios": "^0.27.2", "core-js": "^3.8.3", "element-plus": "^2.2.9", diff --git a/aurora-vue/aurora-blog/src/utils/markdown.ts b/aurora-vue/aurora-blog/src/utils/markdown.ts index 6f6f193..27384d2 100644 --- a/aurora-vue/aurora-blog/src/utils/markdown.ts +++ b/aurora-vue/aurora-blog/src/utils/markdown.ts @@ -13,6 +13,7 @@ export default function markdownToHtml(content: any) { .use(require('markdown-it-footnote')) // 脚注插件 .use(require('markdown-it-abbr')) // 缩写插件 .use(require('markdown-it-ins')) // 插入插件 - .use(require('markdown-it-mark')) // 标记插件 + .use(require('markdown-it-mark')) // 标记插件 + .use(require('@iktakahiro/markdown-it-katex')) return md.render(content) } From cf16259d4adad69ef2fc361e03e9d3612fc71577 Mon Sep 17 00:00:00 2001 From: wanghao Date: Sun, 27 Aug 2023 18:53:53 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=94=AF=E6=8C=81=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=91=98=E8=A6=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/aurora/entity/Article.java | 2 ++ .../main/java/com/aurora/model/dto/ArticleAdminViewDTO.java | 2 ++ .../src/main/java/com/aurora/model/vo/ArticleVO.java | 3 +++ .../src/main/resources/mapper/ArticleMapper.xml | 6 ++++-- aurora-vue/aurora-admin/src/views/article/Article.vue | 4 ++++ 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/aurora-springboot/src/main/java/com/aurora/entity/Article.java b/aurora-springboot/src/main/java/com/aurora/entity/Article.java index 0080fde..b096cf8 100644 --- a/aurora-springboot/src/main/java/com/aurora/entity/Article.java +++ b/aurora-springboot/src/main/java/com/aurora/entity/Article.java @@ -26,6 +26,8 @@ public class Article { private String articleTitle; + private String articleAbstract; + private String articleContent; private Integer isTop; diff --git a/aurora-springboot/src/main/java/com/aurora/model/dto/ArticleAdminViewDTO.java b/aurora-springboot/src/main/java/com/aurora/model/dto/ArticleAdminViewDTO.java index dcae436..a13b973 100644 --- a/aurora-springboot/src/main/java/com/aurora/model/dto/ArticleAdminViewDTO.java +++ b/aurora-springboot/src/main/java/com/aurora/model/dto/ArticleAdminViewDTO.java @@ -22,6 +22,8 @@ public class ArticleAdminViewDTO { private String articleTitle; + private String articleAbstract; + private String articleContent; private String articleCover; diff --git a/aurora-springboot/src/main/java/com/aurora/model/vo/ArticleVO.java b/aurora-springboot/src/main/java/com/aurora/model/vo/ArticleVO.java index b650d96..1a18c63 100644 --- a/aurora-springboot/src/main/java/com/aurora/model/vo/ArticleVO.java +++ b/aurora-springboot/src/main/java/com/aurora/model/vo/ArticleVO.java @@ -26,6 +26,9 @@ public class ArticleVO { @ApiModelProperty(name = "articleContent", value = "文章内容", required = true, dataType = "String") private String articleContent; + @ApiModelProperty(name = "articleAbstract", value = "文章摘要", dataType = "String") + private String articleAbstract; + @ApiModelProperty(name = "articleCover", value = "文章缩略图", dataType = "String") private String articleCover; diff --git a/aurora-springboot/src/main/resources/mapper/ArticleMapper.xml b/aurora-springboot/src/main/resources/mapper/ArticleMapper.xml index 81de718..f25d754 100644 --- a/aurora-springboot/src/main/resources/mapper/ArticleMapper.xml +++ b/aurora-springboot/src/main/resources/mapper/ArticleMapper.xml @@ -63,7 +63,7 @@ category_id, article_cover, article_title, - SUBSTR(article_content, 1, 500) AS article_content, + if(article_abstract is null or article_abstract = '', SUBSTR(article_content, 1, 500), article_abstract) AS article_content, is_top, is_featured, status, @@ -79,6 +79,7 @@ category_id, article_cover, article_title, + article_abstract, article_content, is_top, is_featured, @@ -100,7 +101,7 @@ SELECT a.id AS id, article_cover, article_title, - SUBSTR(article_content, 1, 500) AS article_content, + if(article_abstract is null or article_abstract = '', SUBSTR(article_content, 1, 500), article_abstract) AS article_content, is_top, is_featured, status, @@ -115,6 +116,7 @@ user_id, category_id, article_cover, + article_abstract, article_title, article_content, is_top, diff --git a/aurora-vue/aurora-admin/src/views/article/Article.vue b/aurora-vue/aurora-admin/src/views/article/Article.vue index ec367cc..d0e4c7c 100644 --- a/aurora-vue/aurora-admin/src/views/article/Article.vue +++ b/aurora-vue/aurora-admin/src/views/article/Article.vue @@ -127,6 +127,9 @@ + + +
取 消 @@ -183,6 +186,7 @@ export default { id: null, articleTitle: this.$moment(new Date()).format('YYYY-MM-DD'), articleContent: '', + articleAbstract: '', articleCover: '', categoryName: null, tagNames: [], From ed75653b2f47967c7b2f1ae8de1cfad5cbe9f1bd Mon Sep 17 00:00:00 2001 From: wanghao Date: Mon, 28 Aug 2023 22:08:28 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9SQL=E6=96=87=E4=BB=B6?= =?UTF-8?q?=EF=BC=8Ct=5Farticle=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=EF=BC=9Aarticle=5Fabstract?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aurora-springboot/sql/aurora.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/aurora-springboot/sql/aurora.sql b/aurora-springboot/sql/aurora.sql index 573998b..2a50724 100644 --- a/aurora-springboot/sql/aurora.sql +++ b/aurora-springboot/sql/aurora.sql @@ -28,6 +28,7 @@ CREATE TABLE `t_article` ( `category_id` int NULL DEFAULT NULL COMMENT '文章分类', `article_cover` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '文章缩略图', `article_title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '标题', + `article_abstract` varchar(500) DEFAULT NULL COMMENT '文章摘要,如果该字段为空,默认取文章的前500个字符作为摘要', `article_content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '内容', `is_top` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否置顶 0否 1是', `is_featured` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否推荐 0否 1是', From 36f7a5f9eac7a1174dd17d74f5abf3add32f6eee Mon Sep 17 00:00:00 2001 From: wanghao Date: Mon, 28 Aug 2023 22:41:12 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=89=8D=E5=8F=B0?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=96=87=E7=AB=A0=E6=91=98=E8=A6=81=E7=9A=84?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/ArticleMapper.xml | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/aurora-springboot/src/main/resources/mapper/ArticleMapper.xml b/aurora-springboot/src/main/resources/mapper/ArticleMapper.xml index f25d754..28c61fd 100644 --- a/aurora-springboot/src/main/resources/mapper/ArticleMapper.xml +++ b/aurora-springboot/src/main/resources/mapper/ArticleMapper.xml @@ -140,7 +140,7 @@ SELECT a.id AS id, article_cover, article_title, - SUBSTR(article_content, 1, 500) AS article_content, + if(article_abstract is null or article_abstract = '', SUBSTR(article_content, 1, 500), article_abstract) AS article_content, is_top, is_featured, status, @@ -156,6 +156,7 @@ category_id, article_cover, article_title, + article_abstract, article_content, is_top, is_featured, @@ -196,6 +197,7 @@ category_id, article_cover, article_title, + article_abstract, article_content, is_top, is_featured, @@ -219,7 +221,7 @@ SELECT a.id AS id, article_cover, article_title, - SUBSTR(article_content, 1, 500) AS article_content, + if(article_abstract is null or article_abstract = '', SUBSTR(article_content, 1, 500), article_abstract) AS article_content, is_top, is_featured, status, @@ -235,6 +237,7 @@ category_id, article_cover, article_title, + article_abstract, article_content, is_top, is_featured, @@ -258,7 +261,7 @@ SELECT a.id AS id, article_cover, article_title, - SUBSTR(article_content, 1, 500) AS article_content, + if(article_abstract is null or article_abstract = '', SUBSTR(article_content, 1, 500), article_abstract) AS article_content, is_top, is_featured, status, @@ -274,6 +277,7 @@ category_id, article_cover, article_title, + article_abstract, article_content, is_top, is_featured, @@ -297,7 +301,7 @@ SELECT a.id AS id, article_cover, article_title, - SUBSTR(article_content, 1, 500) AS article_content, + if(article_abstract is null or article_abstract = '', SUBSTR(article_content, 1, 500), article_abstract) AS article_content, is_top, is_featured, status, @@ -313,6 +317,7 @@ category_id, article_cover, article_title, + article_abstract, article_content, is_top, is_featured, @@ -335,7 +340,7 @@ SELECT a.id AS id, article_cover, article_title, - SUBSTR(article_content, 1, 500) AS article_content, + if(article_abstract is null or article_abstract = '', SUBSTR(article_content, 1, 500), article_abstract) AS article_content, is_top, is_featured, status, @@ -351,6 +356,7 @@ category_id, article_cover, article_title, + article_abstract, article_content, is_top, is_featured, @@ -374,7 +380,7 @@ category_id, article_cover, article_title, - SUBSTR(article_content, 1, 500) AS article_content, + if(article_abstract is null or article_abstract = '', SUBSTR(article_content, 1, 500), article_abstract) AS article_content, is_top, is_featured, status, @@ -399,7 +405,7 @@