Coder Social home page Coder Social logo

Fix line breaking about jabref HOT 6 CLOSED

jabref avatar jabref commented on May 9, 2024
Fix line breaking

from jabref.

Comments (6)

stefan-kolb avatar stefan-kolb commented on May 9, 2024

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
}

from jabref.

stefan-kolb avatar stefan-kolb commented on May 9, 2024

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

from jabref.

koppor avatar koppor commented on May 9, 2024

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.

from jabref.

sbitzer avatar sbitzer commented on May 9, 2024

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.

from jabref.

koppor avatar koppor commented on May 9, 2024

Related issue: https://sourceforge.net/p/jabref/feature-requests/854/

from jabref.

lenhard avatar lenhard commented on May 9, 2024

Fixed #187

from jabref.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.