aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bibiman/sanitize/optimized_sanitize.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bibiman/sanitize/optimized_sanitize.rs b/src/bibiman/sanitize/optimized_sanitize.rs
index 3a9dc67..8ee0115 100644
--- a/src/bibiman/sanitize/optimized_sanitize.rs
+++ b/src/bibiman/sanitize/optimized_sanitize.rs
@@ -35,7 +35,7 @@ enum Token {
OpenCurlyBracket,
#[token("}")]
ClosedCurlyBracket,
- #[regex(r"\\[\*\w]+")]
+ #[regex(r"\\[\*\w]+ ?")]
LaTeXMacro,
#[token(r"\ ")]
ForcedSpace,
@@ -85,7 +85,7 @@ pub fn optimized_sanitize(input_text: &str) -> String {
}
Token::LaTeXMacro => {
let texmacro = lex.slice();
- if let Some(x) = LOOKUP.get(&texmacro) {
+ if let Some(x) = LOOKUP.get(&texmacro.trim_end()) {
if let Some(end) = x.1 {
bc_up = true;
counter_actions.insert(bracket_counter + 1, end);
@@ -113,10 +113,10 @@ mod tests {
#[test]
fn check_sanitization() {
let result = optimized_sanitize(
- r"\mkbibquote{Intention} und \mkbibquote{Intentionen \mkbibquote{sind} \hyphen\ bibquote.}",
+ r"\mkbibquote {Intention} und \mkbibquote{Intentionen \mkbibquote{sind} \hyphen\ bibquote\hyphen .}",
);
assert_eq!(
- "\"Intention\" und \"Intentionen \"sind\" - bibquote.\"",
+ "\"Intention\" und \"Intentionen \"sind\" - bibquote-.\"",
result
)
}