views:

41

answers:

1

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

A: 

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.

porneL