Skip to content

Commit

Permalink
Handle \hyphen in citeproc module
Browse files Browse the repository at this point in the history
  • Loading branch information
pfoerster committed Dec 11, 2019
1 parent e0ade23 commit 7347d10
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/citeproc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ fn convert_to_ris(tree: &BibtexSyntaxTree, key: &str) -> Option<RisReference> {

bib_code.push_str(&format_entry(entry, &bib_params));
bib_code.push('\n');
bib_code = bib_code.replace("\\hyphen ", "-");

let ris_code = bibutils::convert(bib_code, InputFormat::Biblatex, OutputFormat::Ris)?;
let ris_lib = RisLibrary::parse(ris_code.lines());
Expand Down Expand Up @@ -147,7 +148,7 @@ mod tests {
}"#,
);
let markdown = render_citation(&tree, "kastenholz").unwrap().value;
assert_eq!(markdown, "Kastenholz, M. A., & Hünenberger, P. H. Computation of methodology\\\\hyphen independent ionic solvation free energies from molecular simulations: I. The electrostatic potential in molecular liquids. *jchph*, *124*. [doi:10.1063/1.2172593](https://doi.org/10.1063/1.2172593)");
assert_eq!(markdown, "Kastenholz, M. A., & Hünenberger, P. H. Computation of methodology\\-independent ionic solvation free energies from molecular simulations: I. The electrostatic potential in molecular liquids. *jchph*, *124*. [doi:10.1063/1.2172593](https://doi.org/10.1063/1.2172593)");
}

#[test]
Expand Down

0 comments on commit 7347d10

Please sign in to comment.