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

**URL:** <https://www.ruby-forum.com/t/to-plain-text-in-hpricot-doesnt-do-what-youd-think-itd-do/120636>\
**Category:** Ruby\
**Created:** [November 19, 2007, 2:00pm UTC](https://www.ruby-forum.com/t/to-plain-text-in-hpricot-doesnt-do-what-youd-think-itd-do/120636 "2007-11-19T14:00:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@maz](https://www.ruby-forum.com/u/maz)\
**Post date:** [November 19, 2007, 2:00pm UTC](https://www.ruby-forum.com/t/to-plain-text-in-hpricot-doesnt-do-what-youd-think-itd-do/120636/1 "2007-11-19T14:00:41Z")

</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   
 and

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?  
Can anyone explain the motivation behind the to\_plain\_text() method  
in  
hpricot? Does anyone agree with my opinion on what it should do?  
Thank you…
