Add remark-emoji render for Markdown (#528)

Co-authored-by: DIYgod <i@diygod.me>
This commit is contained in:
skyone
2023-05-12 12:14:43 +01:00
committed by GitHub
co-authored by DIYgod
parent 14d1970a67
commit efe932d23f
3 changed files with 25 additions and 0 deletions
+1
View File
@@ -124,6 +124,7 @@
"remark-breaks": "^3.0.3",
"remark-directive": "2.0.1",
"remark-directive-rehype": "0.4.2",
"remark-emoji": "^3.1.1",
"remark-frontmatter": "4.0.1",
"remark-gfm": "3.0.1",
"remark-math": "^5.1.1",
+22
View File
@@ -289,6 +289,9 @@ dependencies:
remark-directive-rehype:
specifier: 0.4.2
version: 0.4.2
remark-emoji:
specifier: ^3.1.1
version: 3.1.1
remark-frontmatter:
specifier: 4.0.1
version: 4.0.1
@@ -7338,6 +7341,10 @@ packages:
resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==}
dev: true
/emoticon@4.0.1:
resolution: {integrity: sha512-dqx7eA9YaqyvYtUhJwT4rC1HIp82j5ybS1/vQ42ur+jBe17dJMwZE4+gvL1XadSFfxaPFFGt3Xsw+Y8akThDlw==}
dev: false
/encode-utf8@1.0.3:
resolution: {integrity: sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==}
dev: false
@@ -10646,6 +10653,12 @@ packages:
resolution: {integrity: sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==}
dev: false
/node-emoji@1.11.0:
resolution: {integrity: sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==}
dependencies:
lodash: 4.17.21
dev: false
/node-fetch@2.6.7:
resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==}
engines: {node: 4.x || >=6.0.0}
@@ -11937,6 +11950,15 @@ packages:
- supports-color
dev: false
/remark-emoji@3.1.1:
resolution: {integrity: sha512-kVCTaHzX+/ls67mE8JsGd3ZX511p2FlAPmKhdGpRCb5z6GSwp+3sAIB5oTySIetPh7CtqfGf7JBUt5fyMjgOHw==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dependencies:
emoticon: 4.0.1
mdast-util-find-and-replace: 2.2.2
node-emoji: 1.11.0
dev: false
/remark-frontmatter@4.0.1:
resolution: {integrity: sha512-38fJrB0KnmD3E33a5jZC/5+gGAC2WKNiPw1/fdXJvijBlhA7RCsvJklrYJakS0HedninvaCYW8lQGf9C918GfA==}
dependencies:
+2
View File
@@ -26,6 +26,7 @@ import remarkGfm from "remark-gfm"
import remarkMath from "remark-math"
import remarkParse from "remark-parse"
import remarkRehype from "remark-rehype"
import emoji from "remark-emoji"
import { unified } from "unified"
import { Style } from "~/components/common/Style"
@@ -136,6 +137,7 @@ export const renderPageContent = (
})
.use(remarkPangu)
.use(remarkRehype, { allowDangerousHtml: true })
.use(emoji)
if (!html) {
pipeline.use(rehypeCustomWrapper, {