TCH Houston - Apr 10 2024

NLH Mystery Bounty: April 11 - 22, 2024

 
 
 
 
 
 
Apr 18, 2024 08:27 PM(PST)
Level: 200   Blinds: 3,000 / 6,000   Ante: 1,000

Okay, I've been spending all day trying to figure out the right approach for this, but have come out short, so maybe someone here can point me in the right direction.

Problem: I have a div with class "article-content". There will be around 2-10 of these on the page. Each of them will contain output from a wysiwyg. i.e. texts wrapped in p-tags, some strong tags, em tags and even img tags.

I need to create a preview/excerpt version of these that wont show the images and will append a ... to the end of x characters + a "read more" link. When this is clicked the full article will be shown including images.

Ive seen the following appraches:

Strip the content of the div after x characters and add ... + link. This makes the content a bit fragile since it can strip end tags, and even strip the middle of an image tag resulting in broken html being outputtet.

 
 
 
 
EVENT QUICK INFO
Level
Blinds
/
Ante
 
DAY UPDATES
Entries
Players Remaining
Average Chip Stack
Total Chips