Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom Isbn struct and use it to auto-hyphenate and warn of parsing errors as user types (#125) #262

Merged
merged 2 commits into from
Jul 5, 2021

Conversation

rhigman
Copy link
Member

@rhigman rhigman commented Jul 2, 2021

Fixes #125. A valid ISBN digit string in any format (with or without any number of hyphens/spaces in any positions) now automatically updates to the correctly-hyphenated version on entry in the ISBN field.

Follows the model of #249, using a String wrapper type based on the isbn2::Isbn13 type for ease (e.g. diesel derives) and consistency (with Doi/Orcid types). This includes the addition of a warning tooltip and prevention of save if the ISBN cannot be parsed.

Note that database checks on ISBN validity were/are minimal (as hyphenation rules cannot be easily expressed), so this change represents an increase in strictness, making it no longer possible to save a malformed ISBN in the GUI (although they can still be manually added to the database).

@rhigman rhigman requested a review from ja573 July 2, 2021 16:27
@rhigman rhigman linked an issue Jul 2, 2021 that may be closed by this pull request
@ja573 ja573 merged commit 0ff7c0e into develop Jul 5, 2021
@ja573 ja573 deleted the feature/125_isbn_hyphenation branch July 5, 2021 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatic ISBN hyphenation
2 participants