Coder Social home page Coder Social logo

fast-tagsoup's Introduction

fast-tagsoup's People

Contributors

vshabanov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fast-tagsoup's Issues

1.0.5 build failure

Updating fast-tagsoup to 1.0.5 gives me a build failure:

Configuring fast-tagsoup-1.0.5...
Building fast-tagsoup-1.0.5...
Preprocessing library fast-tagsoup-1.0.5...
[1 of 1] Compiling Text.HTML.TagSoup.Fast ( Text/HTML/TagSoup/Fast.hs, dist/build/Text/HTML/TagSoup/Fast.o )

Text/HTML/TagSoup/Fast.hs:302:24:
    Couldn't match expected type `Char' with actual type `[Char]'
    In the pattern: [i]
    In the pattern: Just [i]
    In a case alternative:
        Just [i]
          -> do { let put !d [] = ...
                      put !d (x : xs) = ...;
                  put d $ encodeChar i }
Failed to install fast-tagsoup-1.0.5

Going back to 1.0.4 resolves the issue.

fast parseTags doesn't parse "<td class=s" the same

Here is a problem I ran into...

I tried to define a instance for TagRep ByteString like this:

import Text.HTML.TagSoup hiding (parseTags, renderTags, (~==))
import qualified Text.HTML.TagSoup as TS
import Text.HTML.TagSoup.Fast
import qualified Data.ByteString.Char8 as BS
...
instance TagRep ByteString where
    toTagRep x = case parseTags x of
                     [a] -> toTagRep a
                     _ -> error $ "When using a TagRep it must be exactly one tag, you gave: " ++ BS.unpack x

and parseTags $ (BS.pack "<td class=s") didn't create the correct tag.

However, things worked if I changed the instance definition to use TS.parseTags instead of the parseTags from the fast package:

instance TagRep ByteString where
    toTagRep x = case TS.parseTags x of
                     [a] -> toTagRep a
                     _ -> error ...

it worked correctly.

Disable tag convertion

Is it possible to disable converting tags to lower case (for example by some param) - It's not useful for XML

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.