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

Omission is missing when word_boundary or break_token options are used #52

Open
gwagener opened this issue Apr 22, 2014 · 5 comments
Open

Comments

@gwagener
Copy link

The behavior I expect is that omission is used any time the text is truncated, regardless of how the end point of the truncation is determined.
#40 had a fix for the omission missing when break_token is used, but was closed with no discussion for some reason.

@parndt
Copy link
Collaborator

parndt commented Apr 23, 2014

@gwagener do you think you could help us out with a failing test?

@hgmnz
Copy link
Owner

hgmnz commented May 13, 2014

@gwagener do you think you could help us out with a failing test?

Yes please :)

@TijmenH
Copy link

TijmenH commented May 27, 2014

I was looking for a truncate that works like this! however, I have the same issue gwagener is experiencing.

When I have this in my view:
= truncate_html(post.body, length: 1000, word_boundary: /\S[\.\?\!]/, omission: (link_to " Read more", post))

truncate works fine, but the omission won't be added. However when I remove the word_boundary option it works fine.

The same goes for break_token

@AlexGunslinger
Copy link

I think I know whats happening here. Im going to write a fix for this (with the proper tests) to see what you guys think.

@gwagener
Copy link
Author

gwagener commented Nov 3, 2014

Thanks @AlexGunslinger!

delxen pushed a commit to skroutz/truncate_html that referenced this issue Apr 18, 2019
When using break_token, omissions was not added in the truncated html.
Fix based on hgmnz/truncate_html#57.
Issue described here hgmnz/truncate_html#52
delxen pushed a commit to skroutz/truncate_html that referenced this issue Apr 18, 2019
When using break_token, omissions was not added in the truncated html.
Fix based on hgmnz/truncate_html#57.
Issue described here hgmnz/truncate_html#52
delxen pushed a commit to skroutz/truncate_html that referenced this issue Apr 18, 2019
When using break_token, omissions was not added in the truncated html.
Fix based on hgmnz/truncate_html#57.
Issue described here hgmnz/truncate_html#52
delxen pushed a commit to skroutz/truncate_html that referenced this issue Apr 19, 2019
When using break_token, omissions was not added in the truncated html.
Fix based on hgmnz/truncate_html#57.
Issue described here hgmnz/truncate_html#52
delxen pushed a commit to skroutz/truncate_html that referenced this issue Apr 22, 2019
When using break_token, omissions was not added in the truncated html.
Fix based on hgmnz/truncate_html#57.
Issue described here hgmnz/truncate_html#52
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

No branches or pull requests

5 participants