1
0
mirror of https://github.com/lise-henry/crowbook synced 2024-09-26 21:20:48 +02:00

fixed french cleaner, now uses em space after —

This commit is contained in:
Elisabeth Henry 2016-02-25 21:47:42 +01:00
parent 27e0b239ca
commit a2afa21dbf

View File

@ -93,7 +93,17 @@ impl Cleaner for French {
new_s.push(current);
match current {
// handle nb space after char
'«'|'—' => {
'—' => {
if is_whitespace(next) {
// use "em space"
new_s.push('\u{2003}');
if let Some(next) = chars.next() {
current = next;
continue;
}
}
},
'«' => {
if is_whitespace(next) {
new_s.push(self.nb_char);
if let Some(next) = chars.next() {
@ -101,6 +111,7 @@ impl Cleaner for French {
continue;
}
}
},
_ => (),
}