Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Text::truncate() on single words.
Fixing this issue required making a small behavior change around how single unbreakable words are handled. Instead of being entirely omitted as before, if a text fragment is not breakable, we do an exact slice. This favors including *some* content over just the ellipsis. While this is a behavior change, I don't think its very intuitive that an inexact truncation will result in no text. This also changes how chains of entities work as shown in the modified test case. This method is in pretty rough shape and at some point in the future, building a more robust HTML munger/tokenizer might be in order if we continue to get issues reported for how the HTML option works. Refs #8673
- Loading branch information
Showing
2 changed files
with
76 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters