From 88b1547782f74c2cd34c0e42d632b7723753aee6 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Thu, 9 Jul 2026 15:36:22 +0200 Subject: [PATCH] fix(quarto-core): normalize CRLF in bootstrap-icons content-prefix test assert Served bootstrap-icons.css carries no SourceInfo/byte-offset and is never compared byte-for-byte with anything downstream, so a Windows checkout (core.autocrlf rewriting the committed-LF vendored file to CRLF) must not false-positive the test on EOL alone. Mirrors the normalize-in-test pattern used for the vendored reveal.js assets. --- .../quarto-core/src/transforms/website_bootstrap_icons.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/quarto-core/src/transforms/website_bootstrap_icons.rs b/crates/quarto-core/src/transforms/website_bootstrap_icons.rs index 02789512a..f287d6a48 100644 --- a/crates/quarto-core/src/transforms/website_bootstrap_icons.rs +++ b/crates/quarto-core/src/transforms/website_bootstrap_icons.rs @@ -111,7 +111,13 @@ mod tests { assert_eq!(css.scope, ArtifactScope::Project); assert_eq!(css.path.as_deref(), Some(Path::new(CSS_REL_PATH))); assert_eq!(css.content_type, "text/css"); - assert!(css.content.starts_with(b"/*!\n * Bootstrap Icons")); + // Line endings are normalized before the check: this served asset carries + // no SourceInfo/byte-offset and is never compared byte-for-byte with + // anything, so a Windows checkout (`core.autocrlf` rewriting the + // committed-LF vendored file to CRLF) must not false-positive on EOL. + let head_len = css.content.len().min(64); + let head = String::from_utf8_lossy(&css.content[..head_len]).replace("\r\n", "\n"); + assert!(head.starts_with("/*!\n * Bootstrap Icons")); let woff = store .get("font:bootstrap-icons:bootstrap-icons.woff")