Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the look of tables #1299

Merged
merged 2 commits into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions src/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 4 additions & 1 deletion src/shared/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -758,6 +758,9 @@ function setupMarkdown() {
const alt_text = item.content;
return `<img class="icon icon-emoji" src="${src}" title="${title}" alt="${alt_text}"/>`;
};
md.renderer.rules.table_open = function () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

return '<table class="table">';
};
}

export function getEmojiMart(
Expand Down