Skip to content

Commit

Permalink
fix(duvet): remove BOM markers (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
camshaft authored Nov 5, 2024
1 parent 5ef7827 commit 517a0e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions duvet/src/specification/ietf/snapshots.tar.gz
Git LFS file not shown
7 changes: 6 additions & 1 deletion duvet/src/specification/ietf/tokenizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,12 @@ macro_rules! expect_contents {

/// Transforms file contents into lines
fn lines(contents: &SourceFile) -> impl Iterator<Item = Token> + '_ {
contents.lines().enumerate().map(move |(line, value)| {
contents.lines().enumerate().map(move |(line, mut value)| {
// look for Byte Order Mark and filter it out
if line == 0 {
value = value.trim_start_matches("\u{feff}");
}

// line numbers start at 1
let line = line + 1;
let value = contents.substr(value).unwrap();
Expand Down

0 comments on commit 517a0e7

Please sign in to comment.