nextcloud / nextcloud/text

Newlines are not preserved from markdown but are saved to it

Open
#7,797 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I noticed some odd markdown behaviour.

Opening a file that was uploaded manually with this content:

## Test





## test

This results in the newlines being removed and the markdown file being overwritten with:

## Test

## test

However if you add newlines in text they will be written to markdown again.

We keep the newlines in text as long as the editor state is preserved, but the markdown will loose them.

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

Reproduce the behavior by opening a manually uploaded Markdown file containing several blank lines between headings, then compare the editor state with the overwritten Markdown. The issue names no files or tests, so first locate the Markdown import/export path and its existing tests. Done means blank lines are preserved when the file is opened and saved, while newly added text remains intact.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.