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

Test/Refactor: split out adobe line splitting logic, added unit tests #174

Merged
merged 1 commit into from
Aug 30, 2023

Conversation

ckhordiasma
Copy link
Collaborator

adobe line splitting

in general for text entry, when you have too many words on a single line, the text editor has to decide how and where to break up overflowing words to transition them to the next line. For most words, the editor will just take the last word that doesn't fit and move it over to the next line. However, what should be done in weird cases like hello/world or hello?world ? Should it treat the whole phrase as a single word, or break on the character in between? That is going to depend on the editor, and I found that the browser's text input field and the adobe forms text input fields made different decisions on when to split words to fit into lines better. In order to make sure this is correct, I split out the line break logic into its own function and put in several unit tests against it.

tokenize unit tests

tokenize just takes a bullet and splits it into an array based on whitespace. I wasn't sure if the \s regex character class also handled unicode half-space and other special whitespace characters, so I added unit tests to ensure that it did work.

@justinthelaw
Copy link
Owner

@ckhordiasma looks like one of your branch's tests failed?

@ckhordiasma
Copy link
Collaborator Author

Ah yeah those were failing from before. We can leave this open until those pass too

@justinthelaw justinthelaw linked an issue Aug 30, 2023 that may be closed by this pull request
1 task
@justinthelaw
Copy link
Owner

Ah yeah those were failing from before. We can leave this open until those pass too

No problem, I don't think it's an issue to merge a branch into a branch of a few tests fail. It's a WIP anyway, and not main branch.

@justinthelaw justinthelaw merged commit afe7238 into refactor-client-pdf-bullets Aug 30, 2023
@justinthelaw justinthelaw deleted the kodama-refactor-bullets branch September 4, 2023 18:34
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.

Refactor(Client): pdf-bullets to TypeScript MVP
3 participants