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

Preserve % sign inside BibTeX fields via cleanup #2375

Merged
merged 4 commits into from
Dec 15, 2016
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- Replaces manual thread management with cached thread pool
- Files can now be moved to subfolders named by a custom format pattern, e.g., based on `entrytype`.
The pattern can be specified in the settings like the filename pattern. [#1092](https://github.com/JabRef/jabref/issues/1092)

Copy link
Member

Choose a reason for hiding this comment

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

Why are there two additional newlines here?

Copy link
Member Author

Choose a reason for hiding this comment

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

To avoid merge conflicts with other PRs.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, fine. I would merge this right now, but maybe we should give @bernhard-kleine at least time until the release tomorrow, before we merge and delete the branch.

We should not forget to merge it before the release, though.


- [#2375](https://github.com/JabRef/jabref/issues/2375) LaTeXCleanup action does now preserve % signs inside BibTeX fields
Copy link
Member

Choose a reason for hiding this comment

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

I would change "preserve" to "escape", and, moreover, "LaTeXCleanup" is not an English word 😄


### Fixed
- We fixed a few groups related issues:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public String format(String oldString) {
newValue = newValue.replace(" ", " "); // Clean up
newValue = newValue.replace("$$", "");
newValue = newValue.replace(" )$", ")$");
newValue = newValue.replace("%", "\\%"); // escape % used for comments in TeX
return newValue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public void test() {
formatter.format("A ${\\Delta}$${\\Sigma}$ modulator for {FPGA} {DSP}"));
}

@Test
public void preservePercentSign() {
assertEquals("\\%", formatter.format("%"));
}

@Test
public void formatExample() {
assertEquals("{VLSI DSP}", formatter.format(formatter.getExampleInput()));
Expand Down