Currently, I am in the process of creating a "news" page for a website.
My goal is to only show the first 15 lines of each news article when the page is loaded, creating a neat appearance for visitors. After the 15th line, I include a "read more" link that triggers a jQuery function to reveal the remaining content.
However, a challenge arises as the news content is stored in the database as HTML. When truncating to 15 lines, it can sometimes result in improperly closed div tags, causing issues with the jQuery functionality. Although I have tried various solutions like closing unclosed tags programmatically, there are still instances where problems persist.
Is there a way to hide a section of an HTML tag based solely on its height without needing to insert an additional tag for hiding and showing the content?