Skip to content

Fix conversion of "'n" and "\'{n}" from LaTeX to Unicode#2464

Merged
tobiasdiez merged 1 commit into
masterfrom
fix-apostroph-n-formatting
Jan 15, 2017
Merged

Fix conversion of "'n" and "\'{n}" from LaTeX to Unicode#2464
tobiasdiez merged 1 commit into
masterfrom
fix-apostroph-n-formatting

Conversation

@lenhard

@lenhard lenhard commented Jan 13, 2017

Copy link
Copy Markdown
Member

This is a follow up for fixing #2458

The combinations \'n and \\'{n} are converted from LaTeX to different symbols in Unicode.

This was really hard to track down. It was not a problem in our conversion maps, but in LatexToUnicode. The ultimate reason is that this code is just an utter mess of hacks and I could only fix this by adding another ugly map on top of this heap.

We have already identified this class to cause performance issues and, as you can see here, it is very difficult to maintain. We should consider removing the functionality and rewriting it from scratch or (preferably) replace it with an external library. After all, converting a LaTeX string to Unicode seems sufficiently well-defined that there is some library for this out there.

  • Change in CHANGELOG.md described
  • Tests created for changes
  • Manually tested changed features in running JabRef

@lenhard lenhard added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Jan 13, 2017

@Siedlerchr Siedlerchr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right and our Latex/Unicode mapping is the hell...
Rest looks good

@Test
public void testApostrophN () {
assertEquals("Maliński", formatter.format("Mali\\'{n}ski"));
assertEquals("Maliʼnski", formatter.format("Mali'nski"));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one assert per tests pls...... 😢

@tobiasdiez tobiasdiez merged commit bc633dc into master Jan 15, 2017
@tobiasdiez tobiasdiez deleted the fix-apostroph-n-formatting branch January 15, 2017 12:07
Siedlerchr added a commit that referenced this pull request Jan 18, 2017
* upstream/master:
  Save deletion of current searchquery (#2469)
  Update dev dependencies (mockito, wiremock, assertj)
  Update BouncyCastle (1.55->1.56), ANTRL4 (4.5.3->4.6), jsoup (1.10.1->1.10.2)
  Group all checker which only check the value of one field (#2437)
  Follow up #2428 (#2438)
  Fix conversion of "'n" and "\'{n}" from LaTeX to Unicode (#2464)
  Fix failing tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants