JuliaWeb/Gumbo.jl

Wrong parsing of non standard (polymer) tags

essenciary opened this issue · 12 comments

Most likely this is not an issue in the Julia wrapper, but I'm wondering if you have any idea on how to solve this? Thank you!

I'm trying to parse polymer web components, but Gumbo chokes on them. Can it be "taught" how to handle extra elements?

genie> Gumbo.parsehtml("""<px-spinner size="100"></px-spinner>""")
genie> HTML Document:
<!DOCTYPE >
<HTML>
  <head></head>
  <body>
    <px-spinner size="100" size="100"></px-spinner size="100">
  </body>
</HTML>

up?

Opened a ticket with the gumbo-parser too. I'll follow up if I hear back from them.

Hey! Sorry for lack of reply; I've been very busy 😓. It's possible this is a bug in the Julia code? IIRC gumbo generally handles wacky nonstandard tags pretty well, so I'm not sure what's going on. It's been long enough since I've worked with this code though that I don't remember offhand. I'm also not sure when I'll have time to look into it, sorry :/

@porterjamesj Thanks for the reply - no worries :) I'll take a look, see if I can spot anything in the Julia code.

Thank you! :)

@porterjamesj I found the problem and submitted a pull request.

The AppVeyor check has failed but I can't see anything wrong with the code:

julia> Pkg.test("Gumbo")
INFO: Testing Gumbo
INFO: Gumbo tests passed

julia> using Revise
julia> using Gumbo

julia> code = """
       <html>
         <body class="main">
           <h1>moo</h1>
           Click me: <my-element cool></my-element>
         </body>
       </html>
       """
"<html>\n  <body class=\"main\">\n    <h1>moo</h1>\n    Click me: <my-element cool></my-element>\n  </body>\n</html>\n"

julia> Gumbo.parsehtml(code)
HTML Document:
<!DOCTYPE >
<HTML>
  <head></head>
  <body class="main">
    <h1>
      moo
    </h1>
    Click me:
    <my-element cool=""></my-element>
  </body>
</HTML>

Just a friendly ping to merge the pull request, in case the original messages were missed :)

Closed by #47

Can you please tag a new release with the fix?

done! JuliaLang/METADATA.jl#15101 sorry for the delay

Thank you!