# To\_plain\_text() in hpricot doesn't do what you'd think it'd do

**URL:** <https://rubytalk.org/t/to-plain-text-in-hpricot-doesnt-do-what-youd-think-itd-do/42321>\
**Category:** ruby-talk\
**Created:** [19 November 2007 13:00 UTC](https://rubytalk.org/t/to-plain-text-in-hpricot-doesnt-do-what-youd-think-itd-do/42321 "2007-11-19T13:00:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Just\_Another\_Victim1](https://avatars.discourse-cdn.com/v4/letter/j/e56c9b/32.png) [@Just\_Another\_Victim1](https://rubytalk.org/u/Just_Another_Victim1)\
**Post date:** [19 November 2007 13:00 UTC](https://rubytalk.org/t/to-plain-text-in-hpricot-doesnt-do-what-youd-think-itd-do/42321/1 "2007-11-19T13:00:03Z")

</div>

You'd think that the to\_plain\_text() method would conver the HTML to  
whatever text would be rendered by a browser. That means stripping all the  
extraneous whitespace, converting \<br\> and \<p\> tags to having appropriate  
carriage returns, etc... Not only does it not do that but links exhibit  
exceptionally weird behaviour. They append the URL of the link in square  
brackets. What's up with that?  
&nbsp;&nbsp;&nbsp;&nbsp;Can anyone explain the motivation behind the to\_plain\_text() method in  
hpricot? Does anyone agree with my opinion on what it should do?  
&nbsp;&nbsp;&nbsp;&nbsp;Thank you...
