Defect #14038

Ordered/unordered lists inside table cell are mangled

Added by Mikhail Sviridov over 4 years ago. Updated almost 2 years ago.

Status:ReopenedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Text formatting
Target version:Candidate for next major release
Resolution:Fixed Affected version:

Description

Here is an example:

test name test
test formatting bold underlined striked out italic code www.redmine.org Wiki page link
test multiline bold
 
underlined
striked out
italic
code
Wiki page link
www.redmine.org

preformatted test
   with indents
test numbered list numbered list:
# item 1
# item 2
test bulleted list bulleted list:
* item 1
* item 2
record after bad rows some data

Look at the rows with "test numbered list" and "test bulleted list" in the first column.
As I understood I can't use quotations inside of table cell as well, but it's not critical.

coffee.jpg (3.39 KB) Mikhail Sviridov, 2013-05-13 12:25


Related issues

Related to Redmine - Feature #6269: RedCloth 4 support New
Related to Redmine - Defect #18223: Table renders wrong if a trailing space is after | symbol Closed

Associated revisions

Revision 11845
Added by Jean-Philippe Lang over 4 years ago

Fixed that ordered/unordered lists inside table cell are mangled (#14038).

Revision 11866
Added by Jean-Philippe Lang over 4 years ago

Removed debug log (#14038).

History

#1 Updated by Mikhail Sviridov over 4 years ago

Here is modified test for lists with subitems:

test numbered list numbered list:
# item 1
# item 2
## subitem 2.1
## subitem 2.2
# item 3
test bulleted list bulleted list:
* item 1
* item 2
* subitem 2.1
* subitem 2.2
* item 3

#2 Updated by Jean-Philippe Lang over 4 years ago

  • Subject changed from can't use bulleted and numbered lists inside table cell to Ordered/unordered lists inside table cell are mangled
  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Target version set to 2.4.0
  • Resolution set to Fixed

The fact that lists are mangled in table cells is fixed in r11845. But they won't be formatted as ul/ol as Redcloth does not support this feature.

#3 Updated by Mischa The Evil over 4 years ago

  • Status changed from Closed to Reopened

The example given by Mikhail in note-1 still doesn't render properly.

|test numbered list|numbered list:
# item 1
# item 2
## subitem 2.1
## subitem 2.2
# item 3|
|test bulleted list|bulleted list:
* item 1
* item 2
** subitem 2.1
** subitem 2.2
* item 3|

now renders as:

<table>
  <tr>
    <td>test numbered list</td>
    <td>numbered list:<br /># item 1<br /># item 2<br />## subitem 2.1<br />## subitem 2.2<br /># item 3</td>
  </tr>
  <tr>
    <td>test bulleted list</td>
    <td>bulleted list:<br />* item 1<br />* item 2<br /><strong>* subitem 2.1<br /></strong>* subitem 2.2<br />* item 3</td>
  </tr>
</table>

So it looks like the nested ul items aren't parsed correctly. I've written an additional test case based on the one in r11845 which will fail at the moment:

  def test_tables_with_lists_with_nested_items
    raw = <<-RAW
This is a table with lists with nested items:
|test numbered list|numbered list:
# item 1
# item 2
## subitem 2.1
## subitem 2.2
# item 3|
|test bulleted list|bulleted list:
* item 1
* item 2
** subitem 2.1
** subitem 2.2
* item 3|
RAW
    expected = <<-EXPECTED
<p>This is a table with lists with nested items:</p>
<table>
  <tr>
    <td>test numbered list</td>
    <td>numbered list:<br /># item 1<br /># item 2<br />## subitem 2.1<br />## subitem 2.2<br /># item 3</td>
  </tr>
  <tr>
    <td>test bulleted list</td>
    <td>bulleted list:<br />* item 1<br />* item 2<br />** subitem 2.1<br />** subitem 2.2<br />* item 3</td>
  </tr>
</table>
EXPECTED
    assert_equal expected.gsub(%r{\s+}, ''), to_html(raw).gsub(%r{\s+}, '')
  end

#4 Updated by Mikhail Sviridov over 4 years ago

Jean-Philippe Lang wrote:

But they won't be formatted as ul/ol as Redcloth does not support this feature.

I think that this fact should be subsequently reported at the Redcloth development site as feature requiest if nobody had done it earlier. It would be great to see this feature in Redmine.

#5 Updated by Mischa The Evil over 4 years ago

Mikhail Sviridov wrote:

Jean-Philippe Lang wrote:

But they won't be formatted as ul/ol as Redcloth does not support this feature.

I think that this fact should be subsequently reported at the Redcloth development site as feature requiest if nobody had done it earlier. It would be great to see this feature in Redmine.

This relies on issue #6269. Redmine is still using (a heavily patched) RedCloth 3.0.4. All new features for RedCloth are integrated only into RedCloth 4.x.
A quick search reveals that there are already requests to format ul/ol lists inside table cells e.g. http://jgarber.lighthouseapp.com/projects/13054-redcloth/tickets/249.

#6 Updated by Jean-Philippe Lang almost 4 years ago

  • Target version changed from 2.4.0 to Candidate for next major release

2.4 feature freeze

#7 Updated by Toshi MARUYAMA almost 4 years ago

#8 Updated by Stephan Brönnimann over 3 years ago

The fix has the unpleasant side-effect, that trailing space of a row leads to wrong rendering:

| 1.1 | 1.2 |
| 2.1 | 2.2 | <-space here
| 3.1 | 3.2 |
| 4.1 | 4.2 |

renders as:
1.1 1.2
2.1 2.2
3.1 3.2
4.1 4.2

#9 Updated by Toshi MARUYAMA almost 3 years ago

  • Related to Defect #18223: Table renders wrong if a trailing space is after | symbol added

#10 Updated by Jens Krämer almost 2 years ago

I attached a patch for the trailing whitespace problem to #18223.

Also available in: Atom PDF