freeCodeCamp / news

freeCodeCamp's JAMstack Developer News publication. Built with 11ty, Ghost, and help from kind contributors like you.
https://freecodecamp.org/news
BSD 3-Clause "New" or "Revised" License
55 stars 39 forks source link

Table not working in /news article in Hashnode #965

Open AbbeyRenn opened 3 weeks ago

AbbeyRenn commented 3 weeks ago

Describe the bug An author recently published an article (this one: https://www.freecodecamp.org/news/how-to-effectively-manage-unique-identifiers-at-scale/) that contained a table at the end, comparing some different tools. The table looked correct in the draft in Hashnode, but once it was published, it looked terrible and wasn't formatted as a table. It looked like this:

89B7ED9C-7ED7-499F-B603-ECC2EE219F6F

The author shared this to try to replace it, and it also didn't work (according to the Hashnode preview): https://gist.github.com/gor8808/943d6cbbf89353354e716f73d677b09d#file-comparison-of-other-unique-identifier-md

To Reproduce Go to the Hashnode editor, copy and paste the table from the above gist in, and click "Preview" - you'll see that it isn't a proper table (looks like this):

https://hashnode.com/draft/66b901a2472b70138041a56e

Expected behavior We just need the table to look like a table with properly aligned/organized info. Here's how it looks in the draft form:

6C9F591C-86A6-4E2A-BB25-2494993ED4FE

Screenshots See above

Desktop (please complete the following information):

Smartphone (please complete the following information): NA

Additional context I've removed the table from the published article at this time, as it didn't look good and would've just confused readers. I'd like to add it back in once we've figured out how to create a table properly in Hashnode.

Hashnode gives this as a guide: https://support.hashnode.com/en/articles/6435291-how-can-i-add-a-table-in-a-blog-post (use markdown formatting) but it doesn't seem to work given what the author used/what I tried in the test draft.

raisedadead commented 3 weeks ago

We need to confirm if this is an issue with our Preview Service AND/OR with our News SSG or Hashnode itself.

Links:

Hashnode Preview Service:

News Repo:

To repro, you can setup the Preview repo locally and use the 66b901a2472b70138041a56e as the id as is and investigate.

yokomatsud commented 3 weeks ago

It seems the <br> tag inside a table cell is causing the problem in the Hashnode's rich text editor.

I could reproduce the issue outside of the freeCodeCamp publication like this:

Screenshots ![hashnode](https://github.com/user-attachments/assets/490c2715-59c5-4809-b560-ccfe3a4fcee3) ![hasnode_preview](https://github.com/user-attachments/assets/744307c6-d96e-4699-9b8d-434d16552fb7)

It happens with either by:

However, I could avoid the problem by swiching to the raw markdown editor mode. It seems this options is disabled in the freeCodeCamp publication, though.

Screenshots ![raw_markdown_editor](https://github.com/user-attachments/assets/d42ec760-9792-492b-b203-5ebfd755d2fa) ![raw_markdown_preview](https://github.com/user-attachments/assets/9f9bb8a2-8c00-48a3-97a8-8d5a136db9f2)
raisedadead commented 3 weeks ago

Okay we need to find a workaround for the table, using the rich text editor or use vanilla plain tables: https://support.hashnode.com/en/articles/6423225-markdown-guidelines#h_6933ed665d