From 79f40095416ad623f18aa0042f7be9c7ed691582 Mon Sep 17 00:00:00 2001 From: Andrew DeLisa Date: Thu, 15 Jun 2023 17:42:22 -0400 Subject: [PATCH] Improve the look of tables (#1299) * feat(css): remove table styling that overrides bootstrap * feat(utils): style MD tables appropriately with bootstrap class --- src/assets/css/main.css | 24 ------------------------ src/shared/utils.ts | 5 ++++- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/src/assets/css/main.css b/src/assets/css/main.css index e1adfc5..82f8433 100644 --- a/src/assets/css/main.css +++ b/src/assets/css/main.css @@ -80,30 +80,6 @@ overflow-x: auto; } -.md-div table { - border-collapse: collapse; - width: 100%; - margin-bottom: 1rem; - border: 1px solid var(--dark); -} - -.md-div table th, -.md-div table td { - padding: 0.3rem; - vertical-align: top; - border-top: 1px solid var(--dark); - border: 1px solid var(--dark); -} - -.md-div table thead th { - vertical-align: bottom; - border-bottom: 2px solid var(--dark); -} - -.md-div table tbody + tbody { - border-top: 2px solid var(--dark); -} - .vote-bar { margin-top: -6.5px; } diff --git a/src/shared/utils.ts b/src/shared/utils.ts index 4a3b298..067b78a 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -739,7 +739,7 @@ function setupMarkdown() { defs: emojiDefs, }) .disable("image"); - var defaultRenderer = md.renderer.rules.image; + const defaultRenderer = md.renderer.rules.image; md.renderer.rules.image = function ( tokens: Token[], idx: number, @@ -758,6 +758,9 @@ function setupMarkdown() { const alt_text = item.content; return `${alt_text}`; }; + md.renderer.rules.table_open = function () { + return ''; + }; } export function getEmojiMart( -- 2.44.1