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

Table/horizontal line rendering bug #1023

Open
FireyDeath4 opened this issue Jan 11, 2025 · 0 comments
Open

Table/horizontal line rendering bug #1023

FireyDeath4 opened this issue Jan 11, 2025 · 0 comments

Comments

@FireyDeath4
Copy link

FireyDeath4 commented Jan 11, 2025

I don't know how to use GitHub but anyway

There's this table in a list that has a horizontal row underneath it, and the horizontal row goes in the table and adds an indent to all the rest of the elements when it renders

Here look just have the code I simplified

Input code:
showdownConverter.makeHtml("# Heading1 \n - List item text\n | Heading 1 | Heading 2 |\n |-------------|-------------|\n | Data 1 | Data 2 |\n | Data 3 | Data 4 |\n\n---\n\n# Heading 2")

Output:
<h1>Heading1</h1>\n<p><ul>\n<li>List item text</p>\n<table>\n<thead>\n<tr>\n<th>Heading 1</th>\n<th>Heading 2</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Data 1</td>\n<td>Data 2</td>\n</tr>\n<tr>\n<td>Data 3</td>\n<td>Data 4</td>\n</tr>\n<tr>\n<td></ul></td>\n<td></td>\n</tr>\n<tr>\n<td><hr /></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<h1>Heading 2</h1>

What the output is supposed to look like:
<h1>Heading1</h1>\n<p><ul>\n<li>List item text</p>\n<table>\n<thead>\n<tr>\n<th>Heading 1</th>\n<th>Heading 2</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Data 1</td>\n<td>Data 2</td>\n</tr>\n<tr>\n<td>Data 3</td>\n<td>Data 4</td>\n</tr>\n</tbody>\n</table>\n</li>\n</ul>\n<hr />\n<h1>Heading 2</h1>

BTW the Markdown formatting came from a response in a ChatGPT JSON file which is what I'm trying to recreate (here and in what I'm doing), so I don't really want to change it to fix it every time there's a table, since that would be tedious for me, and it's the way it's supposed to be formatted. I'll probably mess up the formatting anyway, and I don't know how to do coding so yeah

I'm tired and done so pardon the text format

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

1 participant