-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Avoid conversion of single underscores #2711
Conversation
What about the Unicode Replacement Char? |
CHANGELOG.md
Outdated
@@ -64,6 +64,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# | |||
- Entries with a single corporate author are now correclty exported to the corresponding `corporate` author field in MS-Office XML. [#1497](https://github.com/JabRef/jabref/issues/1497) | |||
- Improved author handling in MS-Office Import/Export | |||
- The `day` part of the biblatex `date` field is now exported to the corresponding `day` field in MS-Office XML. [#2691](https://github.com/JabRef/jabref/issues/2691) | |||
- Single underscores are not converted to during the LaTeX to unicode conversion, which does not follow the rules of LaTeX, but is what users requre. [#2664](https://github.com/JabRef/jabref/issues/2664) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: to Latex during the Latex to Unicode cconversion ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small issue in the changelog, otherwise LGTM
@Test | ||
public void testCustomUnderscoreConversion() { | ||
// our custom version which should preserve the _ | ||
assertEquals("Lorem ipsum_lorem ipsum", formatter.format("Lorem ipsum_lorem ipsum")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please split the test into two tests and convert your comments into nice test names 😸
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course I can ;-)
Excellent idea @Siedlerchr I have implemented this using the replacement char (and it still works). |
Essentially one level deeper in the hierarchy to make sure that BibEntry itself leverages the functionality
As discussed in the devcall: This can be merged aber fixing checkstyle |
Fixes #2664
Single underscores that are not followed by
{
are not converted to unicode during the LaTeX to unicode conversion. This is not actually correct according to the rules of LaTeX, but seems to be an important exception required by our users.This is achieved by the following:
JABREFUNDERSCORE
JABREFUNDERSCORE
with an underscoreTODO: We should find a better magic word instead of
JABREFUNDERSCORE
, because every character will be processed by latex2unicode and that costs performance. However, it should still be long and unique enough so that we avoid accidental conversions. Suggestions anyone?