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 1 commit
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
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