1

I have a string such as

<b>Vitamin A</b><br>Chloe Braided Halter Swim Top,

Using Text.HTML.TagSoup I am attempting to remove all html and just have

"Vitamin Chloe Braided Halter Swim Top" 

using

import qualified Text.HTML.TagSoup as TS 
TS.parseTags "<b>Vitamin A</b><br>Chloe Braided Halter Swim Top,"

[TagText "<b>Vitamin A</b><br>Chloe Braided Halter Swim Top,"]

How can I strip all HTML tags ?

1
  • 3
    But... there aren't any HTML tags in your original string! (And TagSoup is correctl Commented Jun 25, 2015 at 20:04

1 Answer 1

1

Does it have to be with Text.HTML.TagSoup? It seems Hakyll.Web.Html would be a much better fit: https://hackage.haskell.org/package/hakyll-4.1.2.1/docs/Hakyll-Web-Html.html

There you have a function that does what it seems you want:

stripTags :: String -> StringSource

Strip all HTML tags from a string

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.