Skip to content

Commit f70cbd8

Browse files
committed
Use given separator when prefix differ
1 parent d3c58bb commit f70cbd8

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/lib.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -705,8 +705,8 @@ impl PageRangeFormat {
705705
PageRangeFormat::MinimalTwo => minimal(buf, 2, x, &y),
706706
}
707707
} else {
708-
// Prefix is different, write with `-` to follow citeproc test suite.
709-
write!(buf, "{start}-{end}")
708+
// Prefix is different, write entire range.
709+
write!(buf, "{start}{separator}{end}")
710710
}
711711
}
712712
}
@@ -3775,17 +3775,17 @@ mod test {
37753775

37763776
assert_eq!("8n11564–68", run(c15, "8n11564", "8n1568"));
37773777
assert_eq!("n11564–68", run(c15, "n11564", "n1568"));
3778-
assert_eq!("n11564-1568", run(c15, "n11564", "1568"));
3778+
assert_eq!("n115641568", run(c15, "n11564", "1568"));
37793779

3780-
assert_eq!("N110-5", run(exp, "N110 ", " 5"));
3780+
assert_eq!("N1105", run(exp, "N110 ", " 5"));
37813781
assert_eq!("N110–N115", run(exp, "N110 ", " N5"));
3782-
assert_eq!("110-N6", run(exp, "110 ", " N6"));
3783-
assert_eq!("N110-P5", run(exp, "N110 ", " P5"));
3784-
assert_eq!("123N110-N5", run(exp, "123N110 ", " N5"));
3785-
assert_eq!("456K200-99", run(exp, "456K200 ", " 99"));
3786-
assert_eq!("000c23-22", run(exp, "000c23 ", " 22"));
3782+
assert_eq!("110N6", run(exp, "110 ", " N6"));
3783+
assert_eq!("N110P5", run(exp, "N110 ", " P5"));
3784+
assert_eq!("123N110N5", run(exp, "123N110 ", " N5"));
3785+
assert_eq!("456K20099", run(exp, "456K200 ", " 99"));
3786+
assert_eq!("000c2322", run(exp, "000c23 ", " 22"));
37873787

37883788
assert_eq!("n11564–8", run(min, "n11564 ", " n1568"));
3789-
assert_eq!("n11564-1568", run(min, "n11564 ", " 1568"));
3789+
assert_eq!("n115641568", run(min, "n11564 ", " 1568"));
37903790
}
37913791
}

0 commit comments

Comments
 (0)