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

Fix line breaking #114

Closed
koppor opened this issue Aug 19, 2015 · 6 comments
Closed

Fix line breaking #114

koppor opened this issue Aug 19, 2015 · 6 comments
Labels
[outdated] type: bug Confirmed bugs or reports that are very likely to be bugs

Comments

@koppor
Copy link
Member

koppor commented Aug 19, 2015

Somehow, the abstract and keyword fields are incorrectly wrapped. See https://sourceforge.net/p/jabref/discussion/318825/thread/9609d582/ for details.

@koppor koppor added [outdated] type: bug Confirmed bugs or reports that are very likely to be bugs v3 labels Aug 19, 2015
@stefan-kolb
Copy link
Member

The bug should be caused by FieldContentParser.java

Test:

abstract = {The Quick Brown Fox Jumps Over The Lazy Dog. The Quick Brown Fox Jumps\r\n
    \tOver The Lazy Dog. The Quick Brown Fox Jumps Over The Lazy Dog. The

Code (near l.64):

 if (content.length() > i + 1 && content.charAt(i + 1) == '\t' && (content.length() == i + 2 || !Character.isWhitespace(content.charAt(i + 2)))) {
// We have either \n\t followed by non-whitespace, or \n\t at the
// end. Both cases indicate a wrap made by JabRef. Remove and insert space if necessary.
// @formatter:on
content.deleteCharAt(i); // \n
content.deleteCharAt(i); // \t
}

@stefan-kolb
Copy link
Member

The question here is, which fields should accept line breaks?

@koppor
Copy link
Member Author

koppor commented Aug 25, 2015

All multiline fields 😂

Arent't they enlisted in the code somewhere?

Multiline: Abstract, Review
Unsure: comment
Non-multiline: all others

Side note: No one has complained about the difference between UI and serialization. To have the .bib files editable, I would keep the autowrap-feature (refs #123).

Update It seems that somehow the behavior changed from an old version (v2.9.2?) to v2.10 and JabRef removes all wraps and just has a single line. Maybe we should revert that behavior? Currently unsure.

@stefan-kolb stefan-kolb modified the milestone: v2.80 Sep 8, 2015
@sbitzer
Copy link

sbitzer commented Sep 21, 2015

Hi, I'm very much for keeping some line breaks in multiline fields. I previously used the review field to save my own thoughts about a paper. For some entries this has been quite a bit of text which I had separated into paragraphs by putting an empty line between paragraphs in the entry editor. I recently noticed that linebreaks are removed when the database is saved. When it is saved the first time, my empty lines are gone. When it is saved the second time, the remaining linebreaks are gone, too. Needless to say that I found that all my old reviews are only a single paragraph mess now. I don't think that this was an issue earlier and I'm a bit upset about the change in behaviour.

My jabref version is 2.10b2.

@koppor
Copy link
Member Author

koppor commented Sep 24, 2015

@lenhard
Copy link
Member

lenhard commented Oct 7, 2015

Fixed #187

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[outdated] type: bug Confirmed bugs or reports that are very likely to be bugs
Projects
None yet
Development

No branches or pull requests

4 participants