crowdagger / epub-builder

A Rust library for generating EPUB files
Mozilla Public License 2.0
135 stars 45 forks source link

Fix all non-valid characters in IDs #22

Closed thebaron88 closed 2 years ago

thebaron88 commented 2 years ago

I have a source document with backslashes in the file name (windows paths). But there are also lots of other characters that would be invalid. I propose replacing all non-valid characters with underscores. I transcribed the rules as close as possible to the W3 Recommendation ruleset to make it easier to verify. The full ID rules are a little more restrictive (some of the allowed chars above are not valid as the first chars), but this is a good compromise for simplicity.