Fix syntax highlightingg punct filtering ignoring mods

This commit is contained in:
Lukas Wirth 2025-03-05 14:42:43 +01:00
parent 27dc614627
commit 94915fbe48
3 changed files with 4 additions and 6 deletions

View file

@ -593,7 +593,7 @@ fn filter_by_config(highlight: &mut Highlight, config: HighlightConfig) -> bool
*tag = HlTag::Punctuation(HlPunct::Other);
}
}
HlTag::Punctuation(_) if !config.punctuation => return false,
HlTag::Punctuation(_) if !config.punctuation && highlight.mods.is_empty() => return false,
tag @ HlTag::Punctuation(_) if !config.specialize_punctuation => {
*tag = HlTag::Punctuation(HlPunct::Other);
}