Skip to content

Commit

Permalink
fix: remove tbody output
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelbr committed Oct 30, 2024
1 parent 3bb8c6f commit 58d3d83
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,13 @@ Renderer.prototype.listitem = function (text) {
if (item.loose) {
if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {
item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;
if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {
item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;
if (
item.tokens[0].tokens &&
item.tokens[0].tokens.length > 0 &&
item.tokens[0].tokens[0].type === 'text'
) {
item.tokens[0].tokens[0].text =
checkbox + ' ' + item.tokens[0].tokens[0].text;
}
} else {
item.tokens.unshift({
Expand Down Expand Up @@ -228,7 +233,6 @@ Renderer.prototype.table = function (header, body) {

body += this.tablerow({ text: cell });
}
if (body) body = `<tbody>${body}</tbody>`;
}
var table = new Table(
Object.assign(
Expand Down Expand Up @@ -326,9 +330,12 @@ Renderer.prototype.link = function (href, title, text) {
} else {
link = this.o.href(href);
}
out = ansiEscapes.link(link, href
// textLength breaks on '+' in URLs
.replace(/\+/g, '%20'));
out = ansiEscapes.link(
link,
href
// textLength breaks on '+' in URLs
.replace(/\+/g, '%20')
);
} else {
if (hasText) out += this.emoji(text) + ' (';
out += this.o.href(href);
Expand Down

0 comments on commit 58d3d83

Please sign in to comment.