It seems that a recent update added a visual editor for tables, both creating an “insert table” menu and a visual editor for tables on existing posts (whether the table was created in Markdown or using the visual editor).
Unfortunately, it seems that editing a table originally created in markdown causes a lot of issues with formatting. This post I created is a wiki with a few tables. I created all the tables in markdown.
When folks edit the tables with the table editor, I’ve had tables transposed (rows from one table copied to another), columns split at random delimiters, and lots of other problems.
Here is someone trying to add a line who ended up merging two tables and duplicating some content:
Here is a column getting split erroneously (it should be one column that says Author (username, name , or team)
but it got split at the commas to three columns: (1) Author (username
, (2) name
, and (3) or team)
. This exact split has happened across multiple edits from multiple users. What’s weird is the table notation in markdown doesn’t use columns to delineate data – it uses pipes (|
). It seems like maybe the visual editor does split at columns.
I found this thread on Discourse Meta which suggests that not having a pipe at the start or end of a table is correct markdown syntax but causes similar behavior. I can’t find any rows that should be causing this issue, but it’s possible that I missed it.
There are also a number of items in the codebase which have to do with parsing at columns, and even a line which substitutes commas for pipes. I don’t know enough about the codebase to know which of these lines may be relevant.
Assuming the above is an issue with Discourse and not CD-specific, I wonder if we could hide the table edit icon until the issue is resolved. Here is some code to hide it on mobile which should be relatively easy to adapt for all platforms. This wouldn’t eliminate the visual editor for initial posts, but would for editing.
Open to other thoughts, too. I’ve had to manually fix my wiki a dozen times in two days due to this, so would really love to get it resolved.