[F] Fix emoji in about page

This commit is contained in:
Hykilpikonna
2021-12-24 23:00:50 -05:00
parent 1917ee341d
commit 7de73c8fd2
3 changed files with 19 additions and 2 deletions
+1
View File
@@ -12,6 +12,7 @@
"@types/marked": "^4.0.1",
"@types/three": "^0.135.0",
"core-js": "^3.6.5",
"emoji-regex": "^10.0.0",
"marked": "^4.0.6",
"meshline": "^2.0.3",
"moment": "^2.29.1",
+8 -2
View File
@@ -7,6 +7,7 @@
<script lang="ts">
import {Options, Vue} from 'vue-class-component';
import {marked} from 'marked';
import emojiRegex from 'emoji-regex';
@Options({components: {}})
export default class About extends Vue
@@ -17,18 +18,23 @@ export default class About extends Vue
{
// TODO: Cloudflare CDN
fetch("https://raw.githubusercontent.com/hykilpikonna/hykilpikonna/main/README.md").then(it => it.text())
.then(it => this.html = marked(it))
.then(it => this.html = marked(it.replace(emojiRegex(), (emoji) => {
return `<span class="emoji">${emoji}</span>`
})))
}
}
</script>
<style lang="sass" scoped>
<style lang="sass">
@import "../css/colors"
#About
width: min(600px, 80vw)
margin: auto
.emoji
font-weight: normal
// Markdown style
.markdown-content
text-align: justify
+10
View File
@@ -1939,6 +1939,11 @@ ansi-html-community@0.0.8:
resolved "https://registry.npmjs.org/ansi-html-community/-/ansi-html-community-0.0.8.tgz"
integrity sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==
ansi-html-community@^0.0.8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/ansi-html-community/-/ansi-html-community-0.0.8.tgz#69fbc4d6ccbe383f9736934ae34c3f8290f1bf41"
integrity sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==
ansi-regex@^2.0.0:
version "2.1.1"
resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz"
@@ -3667,6 +3672,11 @@ elliptic@^6.5.3:
minimalistic-assert "^1.0.1"
minimalistic-crypto-utils "^1.0.1"
emoji-regex@^10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-10.0.0.tgz#96559e19f82231b436403e059571241d627c42b8"
integrity sha512-KmJa8l6uHi1HrBI34udwlzZY1jOEuID/ft4d8BSSEdRyap7PwBEt910453PJa5MuGvxkLqlt4Uvhu7tttFHViw==
emoji-regex@^7.0.1:
version "7.0.3"
resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz"