March 27, 2008

Generating HTML excerpts

Here is another interesting problem: how do you generate HTML excerpts preserving HTML structure and style? Say you have long XHTML text: <b>This is a <span style="color: #888">very long</span> text.</b> In browser it looks like this: This is a very long text. The text is 25 characters long. Now you ...