Browse Source

fix(News): changes to rendering of tables from markdown not being applied universally

Signed-off-by: Jonathan <theflametrooper@gmail.com>
Jonathan 3 years ago
parent
commit
20d784e8ae

+ 11 - 0
frontend/src/components/modals/EditNews.vue

@@ -67,6 +67,17 @@ export default {
 		...mapGetters({ socket: "websockets/getSocket" })
 	},
 	mounted() {
+		marked.use({
+			renderer: {
+				table(header, body) {
+					return `<table class="table is-striped">
+					<thead>${header}</thead>
+					<tbody>${body}</tbody>
+					</table>`;
+				}
+			}
+		});
+
 		if (this.newsId) {
 			this.socket.dispatch(`news.getNewsFromId`, this.newsId, res => {
 				if (res.status === "success") {

+ 11 - 0
frontend/src/components/modals/WhatIsNew.vue

@@ -37,6 +37,17 @@ export default {
 		}
 	},
 	mounted() {
+		marked.use({
+			renderer: {
+				table(header, body) {
+					return `<table class="table is-striped">
+					<thead>${header}</thead>
+					<tbody>${body}</tbody>
+					</table>`;
+				}
+			}
+		});
+
 		this.socket.dispatch("news.newest", res => {
 			if (res.status !== "success") return;