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

Renderer.prototype.table: <tbody> text included in rendered output #315

Open
eezing opened this issue Sep 19, 2024 · 1 comment
Open

Renderer.prototype.table: <tbody> text included in rendered output #315

eezing opened this issue Sep 19, 2024 · 1 comment

Comments

@eezing
Copy link

eezing commented Sep 19, 2024

Problem

Description

Given source text includes a valid Markdown table
When calling parse with source text
Then rendered table includes <tbody> in cell 1
And has extra row at bottom 

Environment

  • Node.js v20.12.0
  • marked v13.0.3
  • marked-terminal v7.4.0

Example

Code:

import { Marked } from 'marked';
import { markedTerminal } from 'marked-terminal';

const body = `
| Character Name | Hometown        | Description                               |
|----------------|-----------------|-------------------------------------------|
| Aria Windwalker| Elmridge        | A swift and agile archer from the woods   |
| Thorne Ironfist| Stonekeep       | A strong warrior from a mountain fortress |
| Lyra Moonshade | Sunhaven        | A cunning sorceress from a desert city    |
`;

// @ts-ignore
const m = new Marked(markedTerminal());

console.log(m.parse(body));

Console:
Screenshot 2024-09-18 at 17 38 34

Possible Cause

if (body) body = `<tbody>${body}</tbody>`;

Removing this line seemed to resolve the issues.

@kabeep
Copy link

kabeep commented Sep 26, 2024

Same problem and 100% reproduction.

Environment

[email protected]
├── [email protected]
└── [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants