w3c / w3c/editing

Outdent immediately after indent should restore pre-indent DOM (like popular editors do)

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

Nobody has claimed this yet.

Dominant language
HTML
Stars
202
Forks
43
PR merge metrics
No merged PRs in 30d

Description

(Spun off from issue https://github.com/w3c/editing/issues/437).

In popular editors, if you indent something and then immediately outdent it, the result is as if you made no changes. IMHO, that is the expected result, both for the popular editors and for native contenteditable elements.

If you try anything but the simplest of cases, especially in Chromium and WebKit, the result is ... Well, try it out yourself. 😀 You can make it more visually obvious by using multiple levels of divs with colored borders and some brs sprinkled throughout.

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 by reading the linked issue 437 and reproducing the behavior in Chromium and WebKit using nested divs and br elements inside contenteditable content. Done means indenting and then immediately outdenting restores the original DOM, including in the more complex cases described.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
frontend, web-dev
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.