Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linebreaks in Texteditor do not conform to Markdown-Syntax #937

Closed
daftmilk opened this issue Jul 20, 2020 · 5 comments · Fixed by #2455
Closed

Linebreaks in Texteditor do not conform to Markdown-Syntax #937

daftmilk opened this issue Jul 20, 2020 · 5 comments · Fixed by #2455
Labels
1. to develop bug Something isn't working

Comments

@daftmilk
Copy link

Steps to reproduce

  1. Open or create a Textfile in Nextcloud-Webinterface
  2. Start writing a paragraph and insert a manual linebreak via METAKEY + RETURN
  3. Inspect the file in an external editor or on the commandline

Expected behaviour

At the end (before the actual break) of the line with the manual linebreak, there should be two spaces:

The big brown fox<SPACE><SPACE>
jumps over…

Actual behaviour

Nextcloud inserts a backslash:

The big brown fox\
jumps over…

Server configuration

Nextcloud version: 19.0.1

Background/Workaround

In order to make Nextcloud-Textfiles usable with other Markdown-sensitive apps, I need to fix the Nextcloud-flavour of Markdown. That sucks.

$markdown = preg_replace("/\\\(\\n|\\Z)/","  \n",$nextcloud_flavored_markdown);
@kesselb
Copy link
Contributor

kesselb commented Jul 20, 2020

cc @juliushaertl

@juliusknorr
Copy link
Member

We follow the commonmark spec where \\n is a valid line break indicator (see example 631 at https://spec.commonmark.org/0.29/#hard-line-breaks), but I agree that using two spaces might instead might be something to look into as an alternative to make the markdown output a bit more readable in plaintext. I'm not sure how easily we can achieve that yet. Moving to the text repo.

@juliusknorr juliusknorr transferred this issue from nextcloud/server Jul 20, 2020
@herrtreffler
Copy link

@juliushaertl – TextEdit (on Mac OS 10.12.6) and Joplin (1.0.233) works fine with the backslash output from the Text app (as seen in the referred spec). But struggeled with the html output from the Pico CMS app after modify the content function with the "nl2br" twig filter in the themes index.twig file, which results in a html <br /> tag, but leaves the "\" character on line ends in rendered html pages.

@claell
Copy link

claell commented Mar 13, 2021

Also likely related to #593

@MilorES
Copy link

MilorES commented May 27, 2022

The syntax still doesn't work well, now when you put two spaces, when you open it it joins everything, creating chaos in the markdown files.

Source:
imagen

What should be seen:
imagen

This is how it looks in TEXT:
imagen

source after opening it:
imagen

@juliusknorr juliusknorr added bug Something isn't working 1. to develop labels May 27, 2022
@juliusknorr juliusknorr linked a pull request May 27, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants