[uf-discuss] Re: Possible hAtom or maybe hSummary Use Case

Toby A Inkster mail at tobyinkster.co.uk
Wed May 30 02:11:20 PDT 2007

Charles Iliya Krempeaux wrote:

> BUT... how do they choose what goes into the RSS <description>
> element?  (Especially... when they want the RSS <description> element
> to be a summary... and NOT the full text of the post.)

The way my CMS does it is:

	1. There is a field in the database called "summary". If this is
	   non-empty, this is the summary;

	2. Otherwise, if the message contains an HTML comment:
	   <!-- at SUMMARY@--> then it treats everything before that comment
	   as being part of the summary;

	3. Otherwise, it takes the first kilobyte of text, and
	   performs various bits of trickery to ensure that it doesn't
	   break a word in half and closes all its HTML elements properly;

	4. If the above fails, it substitutes "Summary not available", or
	   the equivalent in the same language as the article itself if

This mostly seems to work well, but I agree that <div class="hsummary">
might be a nice idea. If it existed, I'd probably nestle it between #1 and
#2 above, though it's somewhat harder to implement for a naive HTML parser
than #2 is.

Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 95 days, 16:48.]

                           Non-Intuitive Surnames

More information about the microformats-discuss mailing list