The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Excerpting HTML

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Adam Green

Posts: 102
Nickname: darwinian
Registered: Dec, 2005

Adam Green is the author of Ruby.Darwinianweb.com
Excerpting HTML Posted: Jan 4, 2006 10:10 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Adam Green.
Original Post: Excerpting HTML
Feed Title: ruby.darwinianweb.com
Feed URL: http://www.nemesis-one.com/rss.xml
Feed Description: Adam Green's Ruby development site
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Adam Green
Latest Posts From ruby.darwinianweb.com

Advertisement
Another interesting decision is whether to display all of a post's text or just an excerpt. I orginally said I was going to use just an excerpt, and I still want to do that, but there are real problems with excerpting HTML. I can't just crop the text after a certain number of characters or words, because that will leave HTML tags unclosed. This can result in the rest of the page looking like garbage. Parsing out all the HTML tags is easy, but that can result in some hard to read posts. It also means that all the hyperlinks will be removed. It looks like online aggregators that publish excerpts follow this idea of stripping tags, so that is what I will do as well. There will be a link to the original post, of course, so the reader can follow that link to get any necessary hyperlinks in the body of the post.

Read: Excerpting HTML

Topic: New Years Resolutions Previous Topic   Next Topic Topic: Rails Hosting review

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use