With highlight_source(true), when the highlighted span contains wider characters (like emojis and CJK characters), the resulting highlight goes past the intended range (although the underline is correct):
use annotate_snippets::{AnnotationKind, Level, Renderer, Snippet, renderer::DecorStyle};
fn main() {
let text1 = "[lorem ipsum](";
let text2 = "表意文字";
let text3 = ")";
let text = format!("{text1}{text2}{text3}");
// highlight `text2`
let span = text1.len()..text1.len() + text2.len();
let report = &[Level::WARNING
.primary_title("this is a test message")
.element(
Snippet::source(&text)
.path("<anon>")
.annotation(AnnotationKind::Primary.span(span).highlight_source(true)),
)];
let renderer = Renderer::styled().decor_style(DecorStyle::Unicode);
println!("{}", renderer.render(report));
}

With
highlight_source(true), when the highlighted span contains wider characters (like emojis and CJK characters), the resulting highlight goes past the intended range (although the underline is correct):