# How to remove bogusetag by hpricot?

**URL:** <https://www.ruby-forum.com/t/how-to-remove-bogusetag-by-hpricot/176143>\
**Category:** Rails\
**Created:** [September 25, 2009, 8:31am UTC](https://www.ruby-forum.com/t/how-to-remove-bogusetag-by-hpricot/176143 "2009-09-25T08:31:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![flyerhzm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/d26b3c/32.png) [@flyerhzm](https://www.ruby-forum.com/u/flyerhzm)\
**Post date:** [September 25, 2009, 8:31am UTC](https://www.ruby-forum.com/t/how-to-remove-bogusetag-by-hpricot/176143/1 "2009-09-25T08:31:11Z")

</div>

I have use hpricot to translate users’ input html. I want to remove  
bogusetag as follows:

> > doc = Hpricot "
> > 
> > test world
> > 
> > ", :xhtml\_strict =\> true  
> > =\>#\<Hpricot::Doc {elem 
> > 
> > " test world" {bogusetag }
> > 
> > }\>
> 
> > doc.to\_s  
> > =\>"
> > 
> > test world
> > 
> > "

what I expected is “

test world

” without bogusetag , is it  
possible?

---

<div class="post-metadata">

**Author:** ![flyerhzm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/d26b3c/32.png) [@flyerhzm](https://www.ruby-forum.com/u/flyerhzm)\
**Post date:** [September 25, 2009, 9:01pm UTC](https://www.ruby-forum.com/t/how-to-remove-bogusetag-by-hpricot/176143/2 "2009-09-25T21:01:04Z")

</div>

Haven’t tried it, but you may want to look into the :fixup\_tags  
option.

–Matt J.
