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

New lines in Nextcloud #487

Closed
jkalousek opened this Issue Jan 21, 2017 · 11 comments

Comments

Projects
None yet
2 participants
@jkalousek

jkalousek commented Jan 21, 2017

When I crate new note in NextCloud I can see it exactly same in MyOwnNotes on Android and in QOwnNotes. But as soon as I edit this note or create it in first place in QON, in NC web interfrace it adds line breaks.
So for example:

test
test

test

Will become:

test

test


test

It seams that somewhere in the process it adds maybe windows line breaks? Which are not accepted in NextCloud Notes. I assume this because when I open the txt in windows notepad it looks like:
testtesttest

But as soon as I edit it with QON it will become in notepad

test
test

test

I hope I explain it clearly enough. (editing in Android App doesn't cause any problems and line breaks stay same no mater what)

@pbek

This comment has been minimized.

Owner

pbek commented Jan 21, 2017

What NC "web interface" did you use to edit the note in the web?
QON just uses the \n character and removes the \r character from windows to make the note files compatible on all operating systems and for oC Notes.

text.replace(QRegExp("(\\r\\n)|(\\n\\r)|\\r|\\n"), "\n");

Maybe it's something your oC / NC sync tool adds?

@pbek

This comment has been minimized.

Owner

pbek commented Jan 21, 2017

Did you already use a "hex-editor" to check how your note files actually look like?

@jkalousek

This comment has been minimized.

jkalousek commented Jan 21, 2017

Note created in NC "Notes app" (https://github.com/nextcloud/notes - that's what I mean by web interface)
has in place of new lines \n (x0a)
Notes save by QON has \r\n (x0dx0a)
According to PSPad in Hex mode.

My version of QON is 17.01.7

@jkalousek

This comment has been minimized.

jkalousek commented Jan 21, 2017

Ok Step by step once again.
New note in NC Notes app (Web):

test
test

test

HEX:
note_nc

Open the note in QON and adding one line "test" so note is looking like:

test
test

test
test

Closing QON, result in HEX:
note_qon

and of course note in NC is now looking like:

test

test


test

test
@pbek

This comment has been minimized.

Owner

pbek commented Jan 21, 2017

So NC Notes doesn't get along with Windows Line Feeds?
What happens when you create a note with Windows Notepad?

I just found out that QON currently uses Windows Line Feeds under Windows when storing a note, despite that they are removed by the regular expression... If I'm going to change that I have to create a setting for it...

@jkalousek

This comment has been minimized.

jkalousek commented Jan 21, 2017

When I use Windows notepad for creating a note its same story again, it creates both \r\n so there are additional lines in NC.

@pbek

This comment has been minimized.

Owner

pbek commented Jan 21, 2017

I'll see what I can do.

@jkalousek

This comment has been minimized.

jkalousek commented Jan 21, 2017

Maybe it's also question to guys at NC, rendering \r\n as two separate line breakers doesn't seem to be standard.

@pbek pbek added this to the 17.01.8 milestone Jan 22, 2017

@pbek

This comment has been minimized.

Owner

pbek commented Jan 22, 2017

17.01.8

  • you can now set that notes are stored with UNIX newline characters instead
    of the native newline characters in the General settings
    • you can use this for example under Windows if you have troubles with
      newlines in the ownCloud / Nextcloud notes app

There now is a new release, could you please test it and report if the new features work for you?

@pbek pbek added the enhancement label Jan 22, 2017

@jkalousek

This comment has been minimized.

jkalousek commented Jan 22, 2017

Seem to work perfectly, thank you!

@jkalousek jkalousek closed this Jan 22, 2017

@pbek

This comment has been minimized.

Owner

pbek commented Jan 22, 2017

Great, thank you for testing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment