Is there any protection for a widow's orphan using shrimp for rubies on rails?

I have a question about using Prawn for Ruby on Rails.

I use bounding_box for variable length content. When the content overflows to the next page. I would like to have some kind of widow / orphan protection in place. Is there a recommended solution for this?

Is there a way to break the content from the previous page for the last time a paragraph break, and then transfer this paragraph to the next page?

Or perhaps take the last lines x from the previous page so that at least x + 1 the number of lines on the new page?

Thoughts? Suggestions?

+4
source share

Source: https://habr.com/ru/post/1333255/


All Articles