Page MenuHomePhabricator

Editing lists within tables in TinyMCE editor breaks the lists
Closed, ResolvedPublic

Description

The bullet is on one line, the associated text is moved to the next line, so the list is no longer formatted as a list. Here are a few code examples:

Original table in markup:

{| border="1" cellpadding="1" class="wikitable sortable"
 |-
 ! Lore ipsum
 ! Lore ipsum
 ! Lore ipsum
 |- valign="top"
 | Lore ipsum
 | Lore ipsum
 | 
 * Lore ipsum  
 * Lore ipsum
 * Lore ipsum  
 |}

This is what the markup looks like after the table has been edited in the TinyMCA:

{| class="wikitable sortable" cellpadding="1" border="1"
|- 
! Lore ipsum
! Lore ipsum
! Lore ipsum
|- valign="top"
| Lore ipsum
| Lore ipsum
|
*
Lore ipsum
*
Lore ipsum
*
Lore ipsum
|}

Event Timeline

Hi @Nilasae, thanks for taking the time to report this and welcome to Wikimedia Phabricator!
Did aoxomoxoa explicitly agree to work on this (as you assigned them to this task)?
Also, which exact MediaWiki version and extension version is used?

Hi @Aklapper - I'm sorry, this is the first ever bug report I'm adding. @aoxomoxoa kindly helped me out over at the Extension talk page so I figured this was the right thing to do.
The MW version is 1.31.12, extension version is 1.0.7 (9790417) as they recommended for fixing another problem we had with TinyMCE.

Nilasae added a subscriber: aoxomoxoa.

Hi @Nilasae
Thank you for using the TinyMCE extension and taking the time to raise this bug report.
I did notice something strange in your example code. Every line except the first starts with a space. According to the mediawiki documentation here (see sections on Bullet Lists and Preformatted Text) and here (see section Wiki Table Markup Summary, first point after the table) list markup and table markup should start on a new line. Also, space before a new line creates a preformatted block.
This is the standard we have applied in the TinyMCE extension.
Although your code does seem to be interpreted as a table by Mediawiki, I am not sure you can rely on that behaviour as it doesn't confirm to what is described in the documentation. Unfortunately, it is impossible for me to be able to test every alternative to what the documentation describes. I tried the wiki markup without spaces at the start of each line and, in my test system at least, it seems to work correctly.
Later this year I plan to upgrade the TinyMCE extension to support the new parser distributed with mediawiki 1.35 which should make it a lot easier to reproduce exactly how Mediawiki renders wiki markup as html. If you are able to work without the spaces at the start of a line until then, my preference would be to do that. Let me know though if this causes a major problem for you?

Heya @aoxomoxoa - thanks for the info. I will check with my coworker who reported this if those were intentional.

Hi @aoxomoxoa - those were indeed unintentional and so the issue is closed/fixed. Sorry for wasting your time on something so trivial 🙄

aoxomoxoa claimed this task.

Hi @Nilasae , that's no problem at all. It's useful to see where users are having problems anyway and problems are how we learn. I'm really pleased you are using our extension and please do let me know if you have any more question or issues. B.T.W. I released version 1.0.8 on my development GitHub master branch over the weekend with a couple of bug fixes so you may wish to move up to that when you can?