diff --git a/package-lock.json b/package-lock.json index d380d74..992e713 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,6 +18,7 @@ "axios": "^1.7.2", "compressorjs": "^1.2.1", "dicebear": "^9.2.1", + "exiftool-vendored": "^29.0.0", "flatpickr": "^4.6.13", "headlessui": "^0.0.0", "match-sorter": "^6.3.1", @@ -30,7 +31,7 @@ "react-router-dom": "^6.14.2", "react-toastify": "^9.1.3", "rehype-callouts": "^1.4.1", - "remark-flexible-markers": "^1.2.1", + "remark-mark-highlight": "^0.1.1", "sass": "^1.77.8", "sort-by": "^0.0.2", "vite-plugin-sass-dts": "^1.3.25", @@ -717,6 +718,46 @@ "node": ">=18.0.0" } }, + "node_modules/@dicebear/converter/node_modules/@photostructure/tz-lookup": { + "version": "10.0.0", + "resolved": "https://registry.npmmirror.com/@photostructure/tz-lookup/-/tz-lookup-10.0.0.tgz", + "integrity": "sha512-8ZAjoj/irCuvUlyEinQ/HB6A8hP3bD1dgTOZvfl1b9nAwqniutFDHOQRcGM6Crea68bOwPj010f0Z4KkmuLHEA==" + }, + "node_modules/@dicebear/converter/node_modules/exiftool-vendored": { + "version": "27.0.0", + "resolved": "https://registry.npmmirror.com/exiftool-vendored/-/exiftool-vendored-27.0.0.tgz", + "integrity": "sha512-/jHX8Jjadj0YJzpqnuBo1Yy2ln2hnRbBIc+3jcVOLQ6qhHEKsLRlfJ145Ghn7k/EcnfpDzVX3V8AUCTC8juTow==", + "deprecated": "only the latest version is supported", + "dependencies": { + "@photostructure/tz-lookup": "^10.0.0", + "@types/luxon": "^3.4.2", + "batch-cluster": "^13.0.0", + "he": "^1.2.0", + "luxon": "^3.4.4" + }, + "optionalDependencies": { + "exiftool-vendored.exe": "12.85.0", + "exiftool-vendored.pl": "12.85.0" + } + }, + "node_modules/@dicebear/converter/node_modules/exiftool-vendored.exe": { + "version": "12.85.0", + "resolved": "https://registry.npmmirror.com/exiftool-vendored.exe/-/exiftool-vendored.exe-12.85.0.tgz", + "integrity": "sha512-rWsKVp9oXsS79S3bfCNXKeEo4av0xcd7slk/TfPpCa5pojg8ZVXSVfPZMAAlhOuK63YXrKN/e3jRNReeGP+2Gw==", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@dicebear/converter/node_modules/exiftool-vendored.pl": { + "version": "12.85.0", + "resolved": "https://registry.npmmirror.com/exiftool-vendored.pl/-/exiftool-vendored.pl-12.85.0.tgz", + "integrity": "sha512-AelZQCCfl0a0g7PYx90TqbNGlSu2zDbRfCTjGw6bBBYnJF0NUfUWVhTpa8XGe2lHx1KYikH8AkJaey3esAxMAg==", + "optional": true, + "os": [ + "!win32" + ] + }, "node_modules/@dicebear/core": { "version": "9.2.1", "resolved": "https://registry.npmmirror.com/@dicebear/core/-/core-9.2.1.tgz", @@ -1881,10 +1922,9 @@ } }, "node_modules/@photostructure/tz-lookup": { - "version": "10.0.0", - "resolved": "https://registry.npmmirror.com/@photostructure/tz-lookup/-/tz-lookup-10.0.0.tgz", - "integrity": "sha512-8ZAjoj/irCuvUlyEinQ/HB6A8hP3bD1dgTOZvfl1b9nAwqniutFDHOQRcGM6Crea68bOwPj010f0Z4KkmuLHEA==", - "license": "CC0-1.0" + "version": "11.0.0", + "resolved": "https://registry.npmmirror.com/@photostructure/tz-lookup/-/tz-lookup-11.0.0.tgz", + "integrity": "sha512-QMV5/dWtY/MdVPXZs/EApqzyhnqDq1keYEqpS+Xj2uidyaqw2Nk/fWcsszdruIXjdqp1VoWNzsgrO6bUHU1mFw==" }, "node_modules/@pnpm/config.env-replace": { "version": "1.1.0", @@ -4065,38 +4105,34 @@ } }, "node_modules/exiftool-vendored": { - "version": "27.0.0", - "resolved": "https://registry.npmmirror.com/exiftool-vendored/-/exiftool-vendored-27.0.0.tgz", - "integrity": "sha512-/jHX8Jjadj0YJzpqnuBo1Yy2ln2hnRbBIc+3jcVOLQ6qhHEKsLRlfJ145Ghn7k/EcnfpDzVX3V8AUCTC8juTow==", - "deprecated": "only the latest version is supported", - "license": "MIT", + "version": "29.0.0", + "resolved": "https://registry.npmmirror.com/exiftool-vendored/-/exiftool-vendored-29.0.0.tgz", + "integrity": "sha512-BW2Fr7okYP1tN7KIIREy8gOx9WggpPsbKc3BTAS4dLgSup50LjdQttxF9kyDP+27ZayllK+d0rfMYPAixPBtQw==", "dependencies": { - "@photostructure/tz-lookup": "^10.0.0", + "@photostructure/tz-lookup": "^11.0.0", "@types/luxon": "^3.4.2", "batch-cluster": "^13.0.0", "he": "^1.2.0", - "luxon": "^3.4.4" + "luxon": "^3.5.0" }, "optionalDependencies": { - "exiftool-vendored.exe": "12.85.0", - "exiftool-vendored.pl": "12.85.0" + "exiftool-vendored.exe": "13.0.0", + "exiftool-vendored.pl": "13.0.1" } }, "node_modules/exiftool-vendored.exe": { - "version": "12.85.0", - "resolved": "https://registry.npmmirror.com/exiftool-vendored.exe/-/exiftool-vendored.exe-12.85.0.tgz", - "integrity": "sha512-rWsKVp9oXsS79S3bfCNXKeEo4av0xcd7slk/TfPpCa5pojg8ZVXSVfPZMAAlhOuK63YXrKN/e3jRNReeGP+2Gw==", - "license": "MIT", + "version": "13.0.0", + "resolved": "https://registry.npmmirror.com/exiftool-vendored.exe/-/exiftool-vendored.exe-13.0.0.tgz", + "integrity": "sha512-4zAMuFGgxZkOoyQIzZMHv1HlvgyJK3AkNqjAgm8A8V0UmOZO7yv3pH49cDV1OduzFJqgs6yQ6eG4OGydhKtxlg==", "optional": true, "os": [ "win32" ] }, "node_modules/exiftool-vendored.pl": { - "version": "12.85.0", - "resolved": "https://registry.npmmirror.com/exiftool-vendored.pl/-/exiftool-vendored.pl-12.85.0.tgz", - "integrity": "sha512-AelZQCCfl0a0g7PYx90TqbNGlSu2zDbRfCTjGw6bBBYnJF0NUfUWVhTpa8XGe2lHx1KYikH8AkJaey3esAxMAg==", - "license": "MIT", + "version": "13.0.1", + "resolved": "https://registry.npmmirror.com/exiftool-vendored.pl/-/exiftool-vendored.pl-13.0.1.tgz", + "integrity": "sha512-+BRRzjselpWudKR0ltAW5SUt9T82D+gzQN8DdOQUgnSVWWp7oLCeTGBRptbQz+436Ihn/mPzmo/xnf0cv/Qw1A==", "optional": true, "os": [ "!win32" @@ -7753,72 +7789,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-flexible-markers": { - "version": "1.2.1", - "resolved": "https://registry.npmmirror.com/remark-flexible-markers/-/remark-flexible-markers-1.2.1.tgz", - "integrity": "sha512-yAqJ2bRDWfBC7G0A6lHsifMQpzeID10RQc5Pgm29jyAzdJQ7pJozDROeMEk7GW1KznSxIjO5be+fn7Dh+Fbo4A==", - "dependencies": { - "@types/mdast": "^4.0.3", - "unist-builder": "^4.0.0", - "unist-util-find-after": "^5.0.0", - "unist-util-find-all-after": "^5.0.0", - "unist-util-find-all-before": "^5.0.0", - "unist-util-find-between-all": "^1.0.5", - "unist-util-visit": "^5.0.0" - } - }, - "node_modules/remark-flexible-markers/node_modules/@types/mdast": { - "version": "4.0.4", - "resolved": "https://registry.npmmirror.com/@types/mdast/-/mdast-4.0.4.tgz", - "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", - "dependencies": { - "@types/unist": "*" - } - }, - "node_modules/remark-flexible-markers/node_modules/@types/unist": { - "version": "3.0.3", - "resolved": "https://registry.npmmirror.com/@types/unist/-/unist-3.0.3.tgz", - "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==" - }, - "node_modules/remark-flexible-markers/node_modules/unist-util-is": { - "version": "6.0.0", - "resolved": "https://registry.npmmirror.com/unist-util-is/-/unist-util-is-6.0.0.tgz", - "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-flexible-markers/node_modules/unist-util-visit": { - "version": "5.0.0", - "resolved": "https://registry.npmmirror.com/unist-util-visit/-/unist-util-visit-5.0.0.tgz", - "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-is": "^6.0.0", - "unist-util-visit-parents": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-flexible-markers/node_modules/unist-util-visit-parents": { - "version": "6.0.1", - "resolved": "https://registry.npmmirror.com/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz", - "integrity": "sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==", - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-is": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/remark-gemoji": { "version": "7.0.1", "resolved": "https://registry.npmmirror.com/remark-gemoji/-/remark-gemoji-7.0.1.tgz", @@ -7851,6 +7821,11 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-mark-highlight": { + "version": "0.1.1", + "resolved": "https://registry.npmmirror.com/remark-mark-highlight/-/remark-mark-highlight-0.1.1.tgz", + "integrity": "sha512-ot2AE37OKO2YQTcqyZ8VatEGJV/7CXk/RPJHk2TEVm04pT+JLCnoQb4Yj1vdOv2y4ZK45cDylj19gYVHqHz7Tw==" + }, "node_modules/remark-math": { "version": "5.1.1", "resolved": "https://registry.npmmirror.com/remark-math/-/remark-math-5.1.1.tgz", @@ -8714,139 +8689,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/unist-builder": { - "version": "4.0.0", - "resolved": "https://registry.npmmirror.com/unist-builder/-/unist-builder-4.0.0.tgz", - "integrity": "sha512-wmRFnH+BLpZnTKpc5L7O67Kac89s9HMrtELpnNaE6TAobq5DTZZs5YaTQfAZBA9bFPECx2uVAPO31c+GVug8mg==", - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-builder/node_modules/@types/unist": { - "version": "3.0.3", - "resolved": "https://registry.npmmirror.com/@types/unist/-/unist-3.0.3.tgz", - "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==" - }, - "node_modules/unist-util-find-after": { - "version": "5.0.0", - "resolved": "https://registry.npmmirror.com/unist-util-find-after/-/unist-util-find-after-5.0.0.tgz", - "integrity": "sha512-amQa0Ep2m6hE2g72AugUItjbuM8X8cGQnFoHk0pGfrFeT9GZhzN5SW8nRsiGKK7Aif4CrACPENkA6P/Lw6fHGQ==", - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-is": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-find-after/node_modules/@types/unist": { - "version": "3.0.3", - "resolved": "https://registry.npmmirror.com/@types/unist/-/unist-3.0.3.tgz", - "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==" - }, - "node_modules/unist-util-find-after/node_modules/unist-util-is": { - "version": "6.0.0", - "resolved": "https://registry.npmmirror.com/unist-util-is/-/unist-util-is-6.0.0.tgz", - "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-find-all-after": { - "version": "5.0.0", - "resolved": "https://registry.npmmirror.com/unist-util-find-all-after/-/unist-util-find-all-after-5.0.0.tgz", - "integrity": "sha512-nGmOYvTSdGcI4RvrUNfe0mOsqqbbJOtqCQsppsY9KZjmv3nwM3YRgNBwFPdZ8Y+iv9Z/2PDjR9u6u+uK62XTTg==", - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-is": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-find-all-after/node_modules/@types/unist": { - "version": "3.0.3", - "resolved": "https://registry.npmmirror.com/@types/unist/-/unist-3.0.3.tgz", - "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==" - }, - "node_modules/unist-util-find-all-after/node_modules/unist-util-is": { - "version": "6.0.0", - "resolved": "https://registry.npmmirror.com/unist-util-is/-/unist-util-is-6.0.0.tgz", - "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-find-all-before": { - "version": "5.0.0", - "resolved": "https://registry.npmmirror.com/unist-util-find-all-before/-/unist-util-find-all-before-5.0.0.tgz", - "integrity": "sha512-zir6a7GsXfdn4YAWR4F3hLNKZjTjLBJurdyquysvmX38xbftS1+qwvEhutxxHLq0Pp1tW5V1TDiuj+qluuOnKw==", - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-is": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-find-all-before/node_modules/@types/unist": { - "version": "3.0.3", - "resolved": "https://registry.npmmirror.com/@types/unist/-/unist-3.0.3.tgz", - "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==" - }, - "node_modules/unist-util-find-all-before/node_modules/unist-util-is": { - "version": "6.0.0", - "resolved": "https://registry.npmmirror.com/unist-util-is/-/unist-util-is-6.0.0.tgz", - "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-find-between-all": { - "version": "1.0.5", - "resolved": "https://registry.npmmirror.com/unist-util-find-between-all/-/unist-util-find-between-all-1.0.5.tgz", - "integrity": "sha512-zqpIPPzhbG6fI5lqYZhS1UPsMvxV9IY6dwbizLHLPAGNb3pQT3mTvmzXpP1K2lmUh4bhUwAN4gkQcxhR/OLS4g==", - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-is": "^6.0.0" - } - }, - "node_modules/unist-util-find-between-all/node_modules/@types/unist": { - "version": "3.0.3", - "resolved": "https://registry.npmmirror.com/@types/unist/-/unist-3.0.3.tgz", - "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==" - }, - "node_modules/unist-util-find-between-all/node_modules/unist-util-is": { - "version": "6.0.0", - "resolved": "https://registry.npmmirror.com/unist-util-is/-/unist-util-is-6.0.0.tgz", - "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/unist-util-generated": { "version": "2.0.1", "resolved": "https://registry.npmmirror.com/unist-util-generated/-/unist-util-generated-2.0.1.tgz", diff --git a/package.json b/package.json index beab5e9..81b5733 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "axios": "^1.7.2", "compressorjs": "^1.2.1", "dicebear": "^9.2.1", + "exiftool-vendored": "^29.0.0", "flatpickr": "^4.6.13", "headlessui": "^0.0.0", "match-sorter": "^6.3.1", @@ -36,7 +37,7 @@ "react-router-dom": "^6.14.2", "react-toastify": "^9.1.3", "rehype-callouts": "^1.4.1", - "remark-flexible-markers": "^1.2.1", + "remark-mark-highlight": "^0.1.1", "sass": "^1.77.8", "sort-by": "^0.0.2", "vite-plugin-sass-dts": "^1.3.25", diff --git a/src/pages/Create/components/Editor/markdown.scss b/src/pages/Create/components/Editor/markdown.scss index 0631e7d..77d438a 100644 --- a/src/pages/Create/components/Editor/markdown.scss +++ b/src/pages/Create/components/Editor/markdown.scss @@ -1,169 +1,4 @@ .markdown-body { - pre { - margin: 15px 0; - - code.hljs { - border-radius: 10px; - font-weight: 400; - } - } - - h1, - h2, - h3, - h4, - h5, - h6 { - @apply text-black dark:text-gray transition-colors; - } - - h1 { - @apply text-2xl my-6 pb-3 border-b border-[#eee]; - - // &::before { - // content: "✨️"; - // @apply pr-3; - // } - } - - h2 { - @apply relative text-lg my-6; - - // &::before { - // content: ""; - // @apply absolute left-0 top-[50%] -translate-y-1/2 w-2 h-full bg-primary; - // } - } - - h3 { - @apply relative text-lg my-5; - - // &::before { - // content: "#"; - // @apply absolute left-0 top-[50%] -translate-y-1/2 text-primary; - // } - } - - h4, - h5, - h6 { - @apply relative text-lg my-3; - } - - hr { - @apply my-5 border-[#eee] transition-colors; - } - - p code, - ul code { - @apply bg-[rgba(13,110,253,0.1)] dark:bg-[#334052] text-[#0d6efd] rounded-md py-1 px-2 text-sm transition-colors; - } - - // 任务列表 - li.task-list-item { - @apply my-2.5; - }; - - li:not(.task-list-item) { - @apply my-2.5; - } - - // 无序列表 - ul:not(.contains-task-list) { - @apply list-disc ml-6; - } - - // 有序列表 - ol:not([start]) { - counter-reset: counter; - } - - ol > li:not([id^="user-content-"]) { - - &::before { - @apply inline-block w-4 h-4 mt-1 mr-1 leading-none rounded-full text-center text-sm border border-[#11181C] dark:border-gray; - - counter-increment: counter; - content: counter(counter); - } - - & ol > li::before { - @apply inline-block ml-5 border-0 text-base mt-0 leading-normal; - - content: counter(counter) "."; - } - } - - // 引用 - blockquote { - @apply my-5 pl-4 bg-[rgba(246,248,250)] border-l-[4px] border-[#11181C] dark:bg-[rgba(246,248,250,0.1)]; - } - - // 脚注 - .sr-only { - @apply text-[#EAB308] w-full overflow-visible my-10 before:content-['']; - - &::before { - @apply block w-full h-[1px] bg-gray mb-2; - } - } - - ol > li[id^="user-content-"] { - @apply list-decimal ml-3; - } - - // 提示块 - .callout-content { - @apply pt-1; - - & > p { - @apply mb-0; - } - } - - // 数学公式 - .katex { - @apply text-base; - } - - a { - @apply text-primary - } - - p { - @apply leading-9 mb-2; - } - - img { - @apply rounded-xl cursor-pointer transition-all mt-2; - } - - strong { - @apply text-base; - } - - table { - @apply w-full; - - th { - @apply bg-[#f1f7fd] dark:bg-[#334052]; - } - - tr, - th, - td { - @apply border p-[10px_20px]; - } - } - - input[type="checkbox"] { - width: 16px; - height: 16px; - border-radius: 4px; - position: relative; - cursor: not-allowed; - } -}.markdown-body { pre { margin: 15px 0; @@ -227,7 +62,7 @@ // 任务列表 li.task-list-item { @apply my-2.5; - }; + } li:not(.task-list-item) { @apply my-2.5; @@ -243,7 +78,7 @@ counter-reset: counter; } - ol > li:not([id^="user-content-"]) { + ol>li:not([id^="user-content-"]) { &::before { @apply inline-block w-4 h-4 mt-1 mr-1 leading-none rounded-full text-center text-sm border border-[#11181C] dark:border-gray; @@ -252,7 +87,7 @@ content: counter(counter); } - & ol > li::before { + & ol>li::before { @apply inline-block ml-5 border-0 text-base mt-0 leading-normal; content: counter(counter) "."; @@ -273,10 +108,15 @@ } } - ol > li[id^="user-content-"] { + ol>li[id^="user-content-"] { @apply list-decimal ml-3; } + // 高亮标记 + mark { + @apply bg-[#dbfdad] dark:bg-[#9db47e]; + } + // 提示块 .callout-content { @apply pt-1; @@ -289,7 +129,6 @@ // 数学公式 .katex { @apply text-base; - // font-family: ; } a { diff --git a/src/pages/Create/components/Editor/plugins.tsx b/src/pages/Create/components/Editor/plugins.tsx index de9fa08..21f731a 100644 --- a/src/pages/Create/components/Editor/plugins.tsx +++ b/src/pages/Create/components/Editor/plugins.tsx @@ -15,11 +15,11 @@ import 'highlight.js/styles/vs2015.css'; import 'katex/dist/katex.css'; import rehypeCallouts from 'rehype-callouts'; import 'rehype-callouts/theme/obsidian'; -import remarkFlexibleMarkers from "remark-flexible-markers"; +import { remarkMark } from 'remark-mark-highlight'; const markers = (): BytemdPlugin => { return { - remark: (processor) => processor.use(remarkFlexibleMarkers), + remark: (processor) => processor.use(remarkMark), actions: [ { title: '标记',