Comment 3 for bug 336491

Revision history for this message
Paul Everitt (paul-agendaless) wrote : Re: [Bug 336491] Re: Test the policies for show-blog

As a record of what was done, after chatting with Jonathan about what
we did in KARL2:

"""
I just implemented the moral equivalent of this, with an XPath but not
XSLT:

1) Take the string of HTML and parse it with lxml.html. If it fails,
return None.

2) Grab all the text nodes with //text()

3) Skip empty strings in the list.

4) For each string, split on blank spaces and toss out any empty
strings.

5) Return the first 50 words. If over 50 words, add an ellipsis.

6) Store that on the instance, so we don't recompute it 20 times when
showing a blog or search results (since we aren't showing contextual
highlighting on search results.)
"""

On Mar 4, 2009, at 5:01 PM, Nat Katin-Borland wrote:

> Update from OSI:
>
> -For blog description, remove html and grab the first xxx characters
> (how many would you suggest?). Number of characters should be a
> customizable setting.
>
> ** Changed in: karl3
> Status: New => Confirmed
>
> --
> Test the policies for show-blog
> https://bugs.launchpad.net/bugs/336491
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Porting KARL to a new architecture: Confirmed
>
> Bug description:
> Confirm that the UAT in http://carlos.agendaless.com/dko/policies/blog.html#show-blog
> works.