Omission included when truncating by break_token. #57
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This solves the issue #52
I just moved a little bit the logic to stop the truncation by break_token.
Instead of doing it on the truncate method (where it would not include the omission), I did it where the pipeline process occurs, if the token is the break token it will automatically put the chars_remaining at 0, and includes the omission if it happened.
I did it in a way that if the break token is a tag, it will include the omission anyway. If the tag is an opening tag, it will not include the tag, if it is a closing tag, it will include it via the close_open_tags method. (I guess that we don't want to leave any tag open in the string).
Doing it like this, we make sure that the truncation plus the omission will always be shorter or equal than the length param.
I included the proper test for this case.