diff --git a/frontend/package.json b/frontend/package.json index 90f2312..fe09004 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "colubrina-chat", - "version": "1.0.9", + "version": "1.0.10", "private": true, "author": "Troplo ", "license": "GPL-3.0", @@ -22,8 +22,10 @@ "glob-parent": "^5.1.2", "graphql": "^16.3.0", "graphql-tag": "^2.12.6", + "highlight.js": "^11.6.0", "markdown-it": "^13.0.1", "markdown-it-emoji": "git+https://github.com/Troplo/markdown-it-unicode-emoji", + "markdown-it-highlightjs": "^4.0.1", "node-ipc": "git+https://git.troplo.com/Troplo/node-ipc", "nth-check": "^2.0.1", "patch-package": "^6.4.7", diff --git a/frontend/src/assets/styles.css b/frontend/src/assets/styles.css index 880e701..27d6d4f 100644 --- a/frontend/src/assets/styles.css +++ b/frontend/src/assets/styles.css @@ -1,5 +1,12 @@ +/* large codeblock */ +code { + background-color: var(--v-bg-base) !important; + border: 2px solid var(--v-bg-lighten1); + display: block; + padding: 20px; +} .message-hover { - background-color: var(--v-bg-lighten1); + background-color: var(--v-bg-lighten1); border-radius: 5px; } .message-toast { diff --git a/frontend/src/components/Message.vue b/frontend/src/components/Message.vue index 0a81603..f13b41b 100644 --- a/frontend/src/components/Message.vue +++ b/frontend/src/components/Message.vue @@ -160,42 +160,33 @@ diff --git a/frontend/src/main.js b/frontend/src/main.js index 34f4506..839f6fe 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -14,6 +14,7 @@ import "./plugins/dayjs" import SocketIO from "socket.io-client" import twemoji from "twemoji" import VueNativeNotification from "vue-native-notification" +import "highlight.js/styles/github.css" const md = require("markdown-it")({ html: false, // Enable HTML tags in source xhtmlOut: false, // Use '/' to close single tags (
). @@ -48,6 +49,8 @@ const defaultRender = return self.renderToken(tokens, idx, options) } md.use(emoji) +const hljs = require("highlight.js/lib/core") +md.use(require("markdown-it-highlightjs"), { hljs }) md.renderer.rules.emoji = function (token, idx) { return twemoji.parse(token[idx].content, { folder: "svg", diff --git a/frontend/src/views/Communications/CommunicationsChat.vue b/frontend/src/views/Communications/CommunicationsChat.vue index bbb08bf..644de50 100644 --- a/frontend/src/views/Communications/CommunicationsChat.vue +++ b/frontend/src/views/Communications/CommunicationsChat.vue @@ -222,7 +222,10 @@ :key="association.id" top > -