diff --git a/martin/src/fonts/mod.rs b/martin/src/fonts/mod.rs index f81540dcb..5f286e441 100644 --- a/martin/src/fonts/mod.rs +++ b/martin/src/fonts/mod.rs @@ -301,9 +301,8 @@ fn parse_font( name.push_str(style); } // Make sure font name has no slashes or commas, replacing them with spaces and de-duplicating spaces - name = name.replace(['/', ','], " "); name = RE_SPACES - .get_or_init(|| Regex::new(r"\s+").unwrap()) + .get_or_init(|| Regex::new(r"(\s|/|,)+").unwrap()) .replace_all(name.as_str(), " ") .to_string(); diff --git a/tests/test.sh b/tests/test.sh index 4e3ce4601..ec3dbb2dc 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -136,7 +136,7 @@ validate_log() # Make sure the log has just the expected warnings, remove them, and test that there are no other ones test_log_has_str "$LOG_FILE" 'WARN martin::pg::table_source] Table public.table_source has no spatial index on column geom' - test_log_has_str "$LOG_FILE" 'WARN martin::fonts] Ignoring duplicate font Overpass Mono Regular from tests/fixtures/fonts/overpass-mono-regular.ttf because it was already configured from tests/fixtures/fonts/overpass-mono-regular.ttf' + test_log_has_str "$LOG_FILE" 'WARN martin::fonts] Ignoring duplicate font Overpass Mono Regular from tests' echo "Checking for no other warnings or errors in the log" if grep -e ' ERROR ' -e ' WARN ' "$LOG_FILE"; then