nextcloud / nextcloud/text

2 line breaks = new paragraph

Open
#2,809 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
659
Forks
133
Avg merge
1d 20h
Merged PRs (30d)
110

Description

In a previous feature (#2761) I requested removing the auto-double space feature when selecting the Enter key. This was particularly problematic for mobile devices, since a single line break with Shift + Enter was not possible. Ultimately, it was decided not to change this behavior for web, but for mobile it was modified such that two spaces would equate to a new paragraph (#2775).

I'm wondering if we can at least make a modification in web where two single spaces (Shift + Enter twice) will convert to a new paragraph. Or put differently, Shift + Enter twice is treated the same as Enter once.

There are three main reasons for this.

  1. It flows with the traditional markdown logic, whereby a line break between two lines of texts signifies a new paragraph.
  2. This logic will be consistent with the new behavior in mobile (#2775).
  3. It creates less mental burden on the user. There are times when I would like to create two spaces in between paragraphs, to signify a new section/chapter. Currently, to do this properly I will have to hit Shift + Enter once, and then Enter once -- two separate actions. Otherwise, it won't be treated as a new paragraph and formatting will carry over. This is an extra mental step that seems unnecessary.

Note: for users that like the auto-double spacing with the Enter key, this won't change anything.

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

No file or test is named in the issue. Start by locating the web editor's handling of Enter and Shift+Enter, then compare it with the mobile behavior described in #2775. Done means two Shift+Enter actions create the same paragraph boundary as one Enter without changing existing single-Enter behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
content, frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.