wordpress-mobile / wordpress-mobile/AztecEditor-iOS

HTML mode: Adding new lines within <td> tags generates extra, unwanted <td> tags

Open
#930 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

[Type] Bug
Dominant language
Swift
Stars
669
Forks
153
Avg merge
11h 27m
Merged PRs (30d)
4

Description

Expected behavior

When creating tables, I would like any content that I add within a tag to remain within that tag so that it looks like the content is in one table cell after saving. I'd expect to be able to add content to a table cell that includes multiple paragraphs or line breaks.

Actual behavior

If I add line breaks to content within one tag/table cell, then extra, unwanted tags are generated.

Steps to reproduce the behavior
  1. Navigate to the editor for a post and switch to the HTML view.
  2. Copy/paste the following HTML code to create a table:
<table>
<tbody>
<tr>
<td>AB</td>
<td></td>
</tr>
</tbody>
</table>
  1. Now add some line breaks between A and B:
<table>
<tbody>
<tr>
<td>A

B</td>
<td></td>
</tr>
</tbody>
</table>
  1. Save your changes then view the HTML again. You'll see that extra tags are added:
<table>
<tbody>
<tr>
<td>A</td>
<td>B</td>
<td></td>
</tr>
</tbody>
</table>
Tested on iPad Mini, iOS 11.3, Aztec 9.6.1

Reported in 272318-h.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the HTML view and reproduce the table example from the issue on iOS, then inspect the save-and-reload path used by the Aztec editor. Done means line breaks between A and B remain inside one element and the saved HTML no longer creates extra cells.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, swift
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.