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

'\' character appears in-app when doing shift+enter in Nextcloud Text #959

Closed
SamuXzX opened this issue Sep 19, 2020 · 3 comments
Closed
Labels

Comments

@SamuXzX
Copy link

SamuXzX commented Sep 19, 2020

Describe the bug
I copied some notes written in markdown from Simplenote to Nextcloud Notes. Simplenote let me use <br/> to go down a line, but in Nextcloud notes it just didn't work so I deleted them. I searched through old issues and I found that there's a problem with markdown regarding line breaks, but that's not my issue.

My issue is: I edited the note directly in Nextcloud, not with the Notes server app, but modifying the md file in my "Notes" folder. This is to say I used the default markdown editor in Nextcloud. I addes line breaks in the note with shift+enter and they seem to work in the default markdown editor, in the Notes server app and in Nextcloud Notes for Android.
But in Nextcloud Notes for Android, every line break comes with a backslash (\), filling my note with backslashes at every line break both in the editing mode and in the preview mode. This issue doesn't seem to exist in the default markdown editor of Nextcloud and in the Notes server app, only in the latter in editing mode I can see there's a backslash at every line break, as it were the character markdown uses to add line breaks.

To Reproduce
Steps to reproduce the behavior:

  1. Go to your Nextcloud file manager
  2. Click on the md file that is your note
  3. Add line breaks with shift+enter
  4. See error in the Nextcloud notes app: there's a backslash at every line break just added, both in editing and in preview mode.

Expected behavior
If the backslash is the character markdown uses to identify line breaks, the Nextcloud Notes app for Android should not show it, at least in the preview mode.

Screenshots

Default markdown editor in Nextcloud: no backslashes, just line breaks
Schermata da 2020-09-19 14-49-55

Notes server app in Nextcloud, editing mode: backslashes with line breaks
Schermata da 2020-09-19 14-50-17

Notes server app in Nextcloud, preview mode: no backslashes, just line breaks
Schermata da 2020-09-19 14-50-23

Nextcloud notes app for Android, editing mode: backslashes with line breaks
Screenshot_2020-09-19-14-50-39

Nextcloud notes app for Android, preview mode: backslashes with line breaks
Screenshot_2020-09-19-14-50-42

Smartphone:

  • Nextcloud Notes-Version (android app): v2.16.7
  • F-Droid or Play Store: F-droid 1.9
  • Android-Version: 5.1 (EMUI 3.1)
  • Device: Huawei P8 lite smart (tag-l01)

Server

  • Nextcloud version: 19.0.3
  • Nextcloud Notes version (server app): 3.6.4

Stacktrace

@stefan-niedermann
Copy link
Member

cc @korelstar form the Notes server app and @juliushaertl from the Text server app. Does one of you have an idea what might get wrong here? Is it some weird line break stuff (\r\n) or is something with the encoding wrong like \\n (which results in the visible \)?

@stefan-niedermann stefan-niedermann changed the title '\' character appears in-app when doing shift+enter on desktop '\' character appears in-app when doing shift+enter in Nextcloud Text Oct 5, 2020
@juliusknorr
Copy link
Member

juliusknorr commented Oct 6, 2020

\ actually is a valid indicator for a new line in common mark: https://spec.commonmark.org/0.29/#example-631

We use this in text when converting the rendered file back to markdown in order to properly distinguish between hard line breaks and soft breaks which would just be wrapped into the same paragraph when rendering the markdown again.

@stefan-niedermann
Copy link
Member

Okay, to sum this up:

  1. The Nextcloud Text app inserts the \ characters (because the Text app operates destructive and writes back to file what's appropriate and not what has been there initially)
  2. This character is a valid character according to the spec
  3. The Notes Android app will handle this character according to the specification correctly starting with version 2.19.0 - This means, the character will be invisible in view mode but visible in the edit mode (in a lighter grey as a punctuation sign).

Therefore this issue is closed from "our" side. If you keep using the Text app and have an issue with the mentioned behavior, you should upvote the linked issue and subscribe to it.

👀 Android app behavior starting with 2.19.0:

Edit View
grafik grafik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants