Feature #31231

Better handling of HTML tables when creating an issue from an email

Added by Go MAEDA 8 months ago. Updated 4 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Email receiving
Target version:4.1.0
Resolution:Fixed

Description

In the email receiving feature, each cell in HTML tables is converted to a single line with blank lines before and after. As a result, a table is converted to a long sparse text and the appearance is not good.

I think we can improve the appearance and readability by grouping the converted text by row.

[Input]

<table>
  <tr>
    <th>Name (en)</th>
    <th>Name (fr)</th>
    <th>Code</th>
  </tr>
  <tr>
    <td>red</td>
    <td>rouge</td>
    <td>#ff0000</td>
  </tr>
  <tr>
    <td>green</td>
    <td>vert</td>
    <td>#00ff00</td>
  </tr>
  <tr>
    <td>blue</td>
    <td>bleu</td>
    <td>#0000ff</td>
  </tr>
</table>

[Output (before)]

Name (en)

Name (fr)

Code

red

rouge

#ff0000

green

vert

#00ff00

blue

bleu

#0000ff

[Output (after)]

*Name (en)*
*Name (fr)*
*Code*

red
rouge
#ff0000

green
vert
#00ff00

blue
bleu
#0000ff

better-handling-of-html-tables.patch Magnifier - patch (without tests) (1.91 KB) Go MAEDA, 2019-04-20 09:57

add-tests.patch Magnifier (2.31 KB) Mizuki ISHIKAWA, 2019-05-24 08:02

better-handling-of-html-tables-v2.patch Magnifier (1.47 KB) Go MAEDA, 2019-08-18 16:33


Related issues

Blocked by Redmine - Defect #31232: Text may unexpectedly be enclosed in pre tags when an iss... Closed

Associated revisions

Revision 18383
Added by Go MAEDA 4 months ago

Better handling of HTML tables when creating an issue from an email (#31231).

Patch by Go MAEDA.

Revision 18384
Added by Go MAEDA 4 months ago

Add tests for r18383 (#31231).

Patch by Mizuki ISHIKAWA.

History

#1 Updated by Go MAEDA 8 months ago

  • Description updated (diff)

#2 Updated by Go MAEDA 8 months ago

  • Blocked by Defect #31232: Text may unexpectedly be enclosed in pre tags when an issue is created via HTML email added

#3 Updated by Mizuki ISHIKAWA 7 months ago

I have attached a patch to add a test.

#4 Updated by Go MAEDA 6 months ago

  • Target version set to Candidate for next major release

#5 Updated by Marius BALTEANU 4 months ago

Very nice feature, but it doesn't apply cleanly on the current trunk. Can you update the patch? I would like to add support for lists (<ul>) as well.

#6 Updated by Marius BALTEANU 4 months ago

  • Assignee set to Go MAEDA

#7 Updated by Go MAEDA 4 months ago

Updated the patch for the current trunk (r18375).

#8 Updated by Go MAEDA 4 months ago

  • Status changed from New to Closed
  • Resolution set to Fixed

Committed the patches.

#9 Updated by Go MAEDA 4 months ago

  • Subject changed from Better conversion of HTML tables when receiving emails to Better handling of HTML tables when creating an issue from an email

Also available in: Atom PDF