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

Repeated cleaning of % sign in abstract field results in \\% which gives a LaTeX error #2451

Closed
bernhard-kleine opened this issue Jan 9, 2017 · 12 comments
Labels
bib(la)tex bug Confirmed bugs or reports that are very likely to be bugs status: waiting-for-feedback The submitter or other users need to provide more information about the issue

Comments

@bernhard-kleine
Copy link

bernhard-kleine commented Jan 9, 2017

JabRef 3.8.1
windows 7 6.1 amd64
Java 1.8.0_66

I noticed after an errorneous biber compilation that cleaning the % sign is not without risk: I found in the bib-file doublebackslashed % (\\%) which do help since they have the meaning of a new line and and a % sign. Obviously the cleaning does not discriminate between \% and %.

Steps to reproduce:

  1. a bibentry with a % sign in the abstract like PMID 27151464
  2. run Quality > Cleanup Entries ( with abstract: Latex cleanup added) twice

I may be wrong since a cannot reproduce this, but I know for sure that yesterday I found the backslash doubled and I did not anything but the cleanup.

BTW I noted also that between the % sign and the following dot a misplaced white space was added.

Perhaps someone can reproduce this issue.

@matthiasgeiger
Copy link
Member

Hi Bernhard!
Sorry, that I have not seen your post in the forum earlier - I think this problem has already been fixed in #2445 (which is a fix for a similar reported problem #2426) - can you please check using a development build from https://builds.jabref.org/master

Thanks!

@matthiasgeiger matthiasgeiger added the status: waiting-for-feedback The submitter or other users need to provide more information about the issue label Jan 9, 2017
@bernhard-kleine
Copy link
Author

bernhard-kleine commented Jan 9, 2017

Actually I cannot repeat it, therefore I don't know what to do. Even the cleaning of a % sign does not work. I am stymied.

@Siedlerchr
Copy link
Member

Siedlerchr commented Jan 20, 2017

Hi, I tested this in 4b65c3b
and encountered the following behaviour (only in biblatex mode)

Add: abstract: Latex Cleanup
First Cleanup run: The % sign is correctly encoded into %
Second run:, I get: \% with a preceding slash.
Third run, I get: 50\\%
So each time, there is added a backslash.
And after each run I saved it.

When I open the bibtex file, I see:
50\\\\%

@Siedlerchr Siedlerchr added bug Confirmed bugs or reports that are very likely to be bugs bib(la)tex and removed status: waiting-for-feedback The submitter or other users need to provide more information about the issue labels Jan 20, 2017
@bernhard-kleine
Copy link
Author

With 3.8.2. on a fresh database I loaded PMID 27151464 via the Medline fetcher, started Cleanup and got the status: doing cleanup for on entry, but it never finished and the % sign in the abstract was not escaped.

@Siedlerchr
Copy link
Member

I recently experienced the same with the ProtectTerms formatter.
When you run it first, it protects the terms correctly. If you run it again, the already protected terms are protected again, by adding more braces around them...

Siedlerchr added a commit that referenced this issue Feb 5, 2017
Extracted Regexe in Patterns
Fix for #2451
@Siedlerchr
Copy link
Member

@bernhard-kleine I found the problem, it was a problematic RegEx and fixed it.
In a couple of minutes you can try the version here http://builds.jabref.org/multicleanup/

@Siedlerchr Siedlerchr added the status: waiting-for-feedback The submitter or other users need to provide more information about the issue label Feb 5, 2017
tobiasdiez pushed a commit that referenced this issue Feb 5, 2017
Extracted Regexe in Patterns
Fix for #2451
@bernhard-kleine
Copy link
Author

I have installed the file but it has errors: Cleanup does not finish, "save as" not work, I cannot confirm that the problem has been dealt with. Sorry.
(the testing was done on a fresh database with importing the entry PMID 27151464, with contains in the abstract a 50% to be cleaned.)

@Siedlerchr
Copy link
Member

Ah I see the problem. Will fix that.

Siedlerchr added a commit that referenced this issue Feb 5, 2017
* Fix repeated escaping of % sign
Extracted Regexe in Patterns
Fix for #2451

* Fix stackoverflow on regex
@Siedlerchr
Copy link
Member

@bernhard-kleine Should be fixed now. You can try again to download the version from there

@bernhard-kleine
Copy link
Author

bernhard-kleine commented Feb 5, 2017

the cleanup worked thank you, but, still, no way to save the bib-file in the entry, no save as in that snapshot

@Siedlerchr
Copy link
Member

Siedlerchr commented Feb 5, 2017 via email

@lenhard
Copy link
Member

lenhard commented Feb 10, 2017

Since the original problem described here seems to be fixed (and the fix is confirmed), I will close this issue now.

For new problems in the UI, please open a new issue, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bib(la)tex bug Confirmed bugs or reports that are very likely to be bugs status: waiting-for-feedback The submitter or other users need to provide more information about the issue
Projects
None yet
Development

No branches or pull requests

4 participants