プロジェクト

全般

プロフィール

Vote #73904

未完了

Ordered/unordered lists inside table cell are mangled

Admin Redmine さんが約2年前に追加. 約2年前に更新.

ステータス:
Reopend
優先度:
通常
担当者:
-
カテゴリ:
Text formatting_26
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
26
version_id:
32
issue_org_id:
14038
author_id:
16449
assigned_to_id:
1
comments:
10
status_id:
8
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Reopend]

説明

Here is an example:

|test name|test|
|test formatting|bold +underlined+ -striked out- italic @code@ www.redmine.org !coffee.jpg! Wiki page link|
|test multiline|bold
 
+underlined+
-striked out-
italic
@code@
Wiki page link
www.redmine.org
!coffee.jpg!


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.


journals

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|
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
The example given by Mikhail in note-1 still doesn't render properly.

<pre>
|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|
</pre>

now renders as:

<pre>
<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>
</pre>

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:
<pre><code class="ruby">
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
</code></pre>
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
2.4 feature freeze
--------------------------------------------------------------------------------

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

<pre>
| 1.1 | 1.2 |
| 2.1 | 2.2 | <-space here
| 3.1 | 3.2 |
| 4.1 | 4.2 |
</pre>
renders as:

| 1.1 | 1.2 |
| 2.1 | 2.2 |
| 3.1 | 3.2 |
| 4.1 | 4.2 |

--------------------------------------------------------------------------------

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


related_issues

relates,New,6269,RedCloth 4 support
relates,Closed,18223,Table renders wrong if a trailing space is after | symbol

Admin Redmine さんが約2年前に更新

  • カテゴリText formatting_26 にセット
  • 対象バージョンCandidate for next major release_32 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0