diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-06-20 18:53:38 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-06-20 18:53:38 +0200 |
commit | 182467c1d393dee2081ff80f1c049cb145f23123 (patch) | |
tree | 9ce529c815faab2db1f96b0820a78049b7633a8a /src/subtokenize.rs | |
parent | ef5f9a97493fe4a616b49a744d5a571a99ead8e9 (diff) | |
download | markdown-rs-182467c1d393dee2081ff80f1c049cb145f23123.tar.gz markdown-rs-182467c1d393dee2081ff80f1c049cb145f23123.tar.bz2 markdown-rs-182467c1d393dee2081ff80f1c049cb145f23123.zip |
Add support for BOM
Diffstat (limited to 'src/subtokenize.rs')
-rw-r--r-- | src/subtokenize.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/subtokenize.rs b/src/subtokenize.rs index 4a29a01..0623a37 100644 --- a/src/subtokenize.rs +++ b/src/subtokenize.rs @@ -15,6 +15,10 @@ pub fn subtokenize(events: Vec<Event>, codes: &[Code]) -> (Vec<Event>, bool) { let mut link_to_info: HashMap<usize, (usize, usize, usize)> = HashMap::new(); let mut done = true; + if events.is_empty() { + return (events, true); + } + while index < events.len() { let event = &events[index]; |