Defect #14038
open
Ordered/unordered lists inside table cell are mangled
Added by Mikhail Sviridov over 11 years ago.
Updated over 2 years ago.
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.
Files
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 |
- 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.
- 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
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.
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.
- Target version changed from 2.4.0 to Candidate for next major release
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 |
- Related to Defect #18223: Table renders wrong if a trailing space is after | symbol added
I attached a patch for the trailing whitespace problem to #18223.
It seems that lists in tables are still not rendered as such. I there any chance to get this fixed?
BTW: Why does redmine.org use a Redmine version from 2014 for its own issue tracker?
Also available in: Atom
PDF