Skip to content

Commit 65d9eb6

Browse files
author
FrankHB
authored
Handled UTF-8 BOM
Fixed #1155 .
1 parent 303db0d commit 65d9eb6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/book/book.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ fn load_chapter<P: AsRef<Path>>(
264264
format!("Unable to read \"{}\" ({})", link.name, location.display())
265265
})?;
266266

267+
if content.as_bytes().starts_with(b"\xef\xbb\xbf") {
268+
content = content[3..].to_string()
269+
}
270+
267271
let stripped = location
268272
.strip_prefix(&src_dir)
269273
.expect("Chapters are always inside a book");

0 commit comments

Comments
 (0)