Skip to content

Commit

Permalink
Merge pull request #43 from dluschan/main
Browse files Browse the repository at this point in the history
XML element names cannot start with a number or punctuation character.
  • Loading branch information
crowdagger authored Oct 5, 2023
2 parents d253578 + 8d47f1b commit 3365074
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/epub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -777,5 +777,5 @@ fn is_id_char(c: char) -> bool {

// generate an id compatible string, replacing all none ID chars to underscores
fn to_id(s: &str) -> String {
s.replace(|c: char| !is_id_char(c), "_")
"id_".to_string() + &s.replace(|c: char| !is_id_char(c), "_")
}

0 comments on commit 3365074

Please sign in to comment.