Giter Club home page Giter Club logo

Comments (6)

philss avatar philss commented on May 27, 2024

I'm into it. @aselder Is it possible to provide a snippet so I can reproduce the error?

from floki.

aselder avatar aselder commented on May 27, 2024

from floki.

philss avatar philss commented on May 27, 2024

OK, thank you!

from floki.

aselder avatar aselder commented on May 27, 2024

@philss

Here’s some info that I think clarifies the root cause. I just tried to parse that html that was found to be bad on the one page:

<spanclass=\"trade\">™ curl gelée<br><br><br></spanclass=\"trade\">

With Floki 0.35.0, I get the same exact error we saw on production:

iex(3)> Floki.parse_fragment(f)
** (MatchError) no match of right hand side value: [{"=", "="}, {"\"trade\"", "\"trade\""}]
    (floki 0.35.0) src/floki_mochi_html.erl:257: :floki_mochi_html.norm/2
    (floki 0.35.0) src/floki_mochi_html.erl:241: :floki_mochi_html.tree/3
    (floki 0.35.0) src/floki_mochi_html.erl:120: :floki_mochi_html.parse_tokens/2
    (floki 0.35.0) lib/floki/html_parser/mochiweb.ex:10: Floki.HTMLParser.Mochiweb.parse_document/2
    iex:3: (file)

with Floki 0.34.3, it works:

iex(3)> Floki.parse_fragment(f)
{:ok,
 [
   {"spanclass", [{"=", "="}, {"\"trade\"", "\"trade\""}],
    ["™ curl gelée", {"br", [], []}, {"br", [], []}, {"br", [], []}]}
 ]}

So it was some invalid html that was not causing problem before, but after upgrading floki, it was an error

from floki.

philss avatar philss commented on May 27, 2024

@aselder thank you so much! It was a silly mistake of mine. I'm going to release a patch version soon :)

from floki.

philss avatar philss commented on May 27, 2024

Done! Please try the version 0.35.1 :)

from floki.

Related Issues (20)

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.