Why does <space> <manual line break> leave a blank line?

I’m working on a dictionary for a minority language in Papua New Guinea. The dictionary software (Flex) has generally done a good job, but it has left spaces at the end of lines. Where these are followed by manual line break characters, the manual line break appears on a line by itself. If I remove the space, the manual line break goes back to the previous line and there is no waste of space. Since manual line break is a whitespace character, I thought LibreOffice would behave like MS Word and leave it on the end of the previous line, no matter how many spaces there were before it.

Is this a known bug? If so, do you know the reference number, and if there are plans to fix it?
In the screenshot, I have turned on the display of whitespace characters, and there is a space after “morally”, before the manual line break. When I delete that space, the blank line disappears.

(Edit: activated screenshot -AK)

Which operating system, LO version, and file format are you using? An example file would also help. I have not seen or heard of this behaviour so it sounds like it may be somewhat specific.

Thanks, oweng, for responding. I’m doing this on Windows XP SP3, LO 4.0.4.2. The Writer file is .fodt. I have a screenshot and a small sample file – how do I post them?

Jim

I have marked your question up Jim, so you should now be able to edit your original question and attach the files or add a link to them. Sorry for not doing this previously.

Thanks for attaching the screenshot. The Flex software appears to be writing out the document with one line of output ending in a line feed character (U+000a) which looks like ↵ rather than a carriage return (U+000d) which shows as a pilcrow ¶. There is quite a bit going on so I will explain what I am seeing.

All of the lines as you say are being generated with a single space prior to either mark (line feed or carriage return). The space is not ideal for line breaking but it may be used in your case to ensure that a character style terminates. Each of the lines (e.g., ab gag zamar | rainbow | renbo | ñe modao: bel halaizomar) appears to be set in a different style, with the last and sometimes first having a pair of different styles. In the example as shown this can only be effective if character (rather than paragraph) styles are used as a line feed does not terminate a paragraph style. So that may be why a leading space precedes each newline character (line feed, carriage return, etc.)

As to why the line feed character is being treated the way it is I can surmise that Word has special handling built into it that overrides the default Unicode interpretation of these characters. An example from your screenshot which exhibits the problem (e.g., “man who is bad, physically or morally ↵ man nogut”) is essentially a single paragraph as only a carriage return is interpreted as being a paragraph terminator. In this context the line feed is simply treated as a separate character or word like “a”. The space and line feed (LF) characters both have a neutral binding so SPACE+LF occuring at line end can be broken / split. This behaviour seems consistent in LO in terms of ODT/DOC/DOCX all be treated the same way. MS Word probably treats SPACE+LF as a single unit / word i.e., as a special case.

Is it possible to get the Flex software to write out the file without a leading space, or better yet with all lines using a carriage return rather than one using a line feed?

I observed adding of additional blank lines after and email address containing line and an URL containing line and saving the file in doc format.

Triggered by this question I did some more testing and created a bug report fdo#67761. There are all my detail to be seen.

Bug fdo#67761 has been marked as a duplicate of https://bugs.freedesktop.org/show_bug.cgi?id=66165 which has been fixed for v4.0.5 and v4.1.