mirror of
https://git.pumpin.online/funkpower/catena.git
synced 2026-11-18 17:55:40 +00:00
0.2.2 — a subtitle begins with a capital
title_case counted small words from the start of the whole string, so every subtitle that opened with one was set in lower case: 'Aesthetic in Kant: a Critique', 'Born Fighting: the Scots-Irish'. A colon starts a title of its own and the first word of one is capitalised however small it is. Found by book-pipeline, which had been proposing a title page's capitals verbatim into a catalogue and needed this to stop.
This commit is contained in:
4 files changed
+104
-55
No files matched your search
@@ -260,9 +260,14 @@ mod tests {
|
||||
#[test]
|
||||
fn an_underscored_title_is_cleaned_before_it_is_cased() {
|
||||
let cleaned = clean(&book("THE FALL_ AND THE RISE_txt", "Arendt, Hannah"));
|
||||
// "And" is capitalised because the colon starts a subtitle, and the
|
||||
// first word of one is capitalised however small it is. This asserted
|
||||
// "and" until the rule was found to be counting small words from the
|
||||
// start of the whole string, which set every subtitle opening "A",
|
||||
// "The" or "An" in lower case.
|
||||
assert_eq!(
|
||||
cleaned.book.title.as_deref(),
|
||||
Some("The Fall: and the Rise")
|
||||
Some("The Fall: And the Rise")
|
||||
);
|
||||
assert_eq!(cleaned.changes.len(), 2);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user