Long article pagination based on height

I am trying to do a pagination for long article which has html tags inside based on height.

For ex: Within Max height 768, i want to display the article with pagination.
My article may have html tags <b></b>,<i></i>,<img/>, etc.

I’ve done this by fixing the number of characters per page. But the tags also coming under the character count.

Total chars per page = 3000
my 3000th char is <, 30001 - 3004 chars are br/>.

So <br/> tag gets splitted.

Please help on this.


Are you fetching this out of a database?
1: I would first get the length by applying $copy = strip_tags($yourContent); Now you can measure accurately 3000 characters, but what if a word gets split?

2: Then you could do a regular expression to match maybe the last sentence from the copy. strstr(substr($copy, 0, -50), …

Err actually, this is a tricky one, but I tried to get the ball rolling :stuck_out_tongue:

Thanks for your reply.
I want the line break for <br/> tag. I dont want to strip the tags.

Please help me.