Invalid html when creating list from a paragprah

Open
#1,308 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
swift
Domain
mobile

Research direction

Reproduce the issue by loading

sample text

through setHTML, selecting the text, and converting it to a list. Trace the HTML conversion used by getHTMLWithPrettify(false), then verify that the result is a standalone ul containing the li rather than a ul nested inside p.

Written by the indexing model from the issue text.

Description

Describe the bug
Aztec editor creates invalid html when creating a list from a previously loaded paragraph

To Reproduce
Steps to reproduce the behavior:

  • Load the following html into the TextView via the setHTML method: <p>sample text</p>
  • Select the text and make it a list
  • Get the text with getHTMLWithPrettify(false)

Expected behavior
Same result when creating a list form scratch:

<ul>
  <li>sample text</li>
</ul>

Actual behavior

<p>
  <ul>
    <li>sample text</li>
  </ul>
</p>

This is invalid html

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

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.

More from wordpress-mobile/AztecEditor-iOS

All issues in wordpress-mobile/AztecEditor-iOS

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.