Pasting Google Sheets table with a cell that contain a line break

AI-generated summary

Pasting Google Sheets table with line breaks issue: chicagostylehotdog reports that when pasting a table from Google Sheets into Discourse, the table formatting is broken if any cell contains a line break. This issue occurs regardless of whether the line break is entered directly or using the CHAR(10) function. As a result, Discourse adds quotes around the cell contents and fails to recognize the vertical bars for table formatting. anon82467725 has confirmed that this bug can be reproduced with various spreadsheet software, including Google Sheets, Microsoft Excel, and Apple Numbers.

Pasting a table from Google Sheets does not format as a table if any of the cells contain a line break. This was working properly a few months ago, but now it seems that markdown doesn’t recognize it as a table. This happens regardless of whether I directly use a line break or CHAR(10) in the workbook cell/formula. Any time I have a line break in a cell, discourse/markdown is adding quotes around the cell contents and not giving me the vertical bars for table formatting.

Previously, I was using a line break in a cell to add a blank row based on a conditional (in this example, I’m adding a blank row under the test1 row by adding a string “|”&CHAR(10)&“|-” )

Which looks like this:

Sheep Score # Solos Used
test 0 0
-
test1 0 0
test2 0 0

But now it’s doing this:

Sheep Score # Solos Used
test 0 0
test1 0 “0|
|-”
test2 0 0

4 Likes

I can reproduce the bug with Google Sheets, along with Microsoft Excel and Apple Numbers.

2 Likes

The issue was fixed with that PR

https://github.com/discourse/discourse/pull/12194