is there a way i can truncate a post. eg. create a blog summary. while not breaking the markup?
- 1st i am thinking of HTML
- if that can be done, how do i work on markdown posts
i use PHP/Zend Framework/MySQL/Doctrine2
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In case of HTML it’s been answered before.
In case of Markdown, you could convert whole Markdown text to HTML, and see previous point. Otherwise you’d have to write Markdown parser (state machine) that parses source up to a certain point, keeping track of all open constructs, and then closes all of them.