uiowa / uiowa

The base application on Acquia Cloud for the University of Iowa.
11 stars 9 forks source link

CKEditor breaks some <th> tags #7440

Open quamsta opened 6 months ago

quamsta commented 6 months ago

This is just an issue that is known upstream (CKEditor and Drupal) that I ran into while making a "complicated" table in CKEditor 5 that I wanted to ensure the team was aware of/tracking at some level.

Problem

Essentially, CKEditor doesn't understand that <th> tags can officially exist outside of <thead> (e.g., in <tbody>) and when you attempt to put <th> tags within <tbody>, the editor will move them up to <thead> regardless of where they were before, causing unexpected mangling of table content.

The CKEditor upstream issue explains it a lot better: https://github.com/ckeditor/ckeditor5/issues/14911

Drupal upstream issue: https://www.drupal.org/project/drupal/issues/3384400

This presents some accessibility issues as noted by this person: https://github.com/ckeditor/ckeditor5/issues/14911#issuecomment-1942852909

The table bugs here are really critical. I’m responding to an RFP for a city government website proposal, and one question completely disqualifies Drupal 10 with CKE5 as inconformant:

To comply with the U.S. Access Board Web-based Intranet and Internet Information and Applications (1194.22) provisions, the solution provides the following:

The solution allows markup to be used to associate data cells and header cells for data tables that have two or more logical levels of row or column headers.

Steps to reproduce

Try to make a table with <th> tag within <tbody>. It gets moved.

Proposed solution

Wait for upstream issue to be resolved and update CKEditor5?

bewoldt commented 4 months ago

Just came across this issue on a page I was working on today.