bug in SGML parser

Discussion in 'Ruby' started by cesium62@yahoo.com, Dec 7, 2006.

  1. Guest

    The sgml parser
    /usr/local/lib/ruby/gems/1.8/gems/htmltools-1.10/lib/html/sgml-parser.rb
    does not correctly handle character references. Yahoo sometimes
    generates a character reference that looks like "'". Firefox
    displays this as a single quote. sgml-parser.rb raises an exception.

    rescued: invalid value for Integer: "039" at Wed Dec 06 18:02:56 PST
    2006
    /usr/local/lib/ruby/gems/1.8/gems/htmltools-1.10/lib/html/sgml-parser.rb:335:in
    `Integer'/usr/local/lib/ruby/gems/1.8/gems/htmltools-1.10/lib/html/sgml-parser.rb:335:in
    `handle_charref'/usr/local/lib/ruby/gems/1.8/gems/htmltools-1.10/lib/html/sgml-parser.rb:159:in
    `goahead'/usr/local/lib/ruby/gems/1.8/gems/htmltools-1.10/lib/html/sgml-parser.rb:88:in
    `feed'/usr/local/lib/ruby/gems/1.8/gems/rubyful_soup-1.0.4/lib/rubyful_soup.rb:547:in
    `feed'/usr/local/lib/ruby/gems/1.8/gems/rubyful_soup-1.0.4/lib/rubyful_soup.rb

    Possible fix: In handle_charref, strip leading zeroes from 'name'
    prior to calling 'Integer'.
     
    , Dec 7, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. (Pete Cresswell)

    SGML Parser doesn't like <script> contents?

    (Pete Cresswell), Dec 24, 2004, in forum: HTML
    Replies:
    30
    Views:
    1,399
    dszady
    Dec 27, 2004
  2. Clifford W. Racz
    Replies:
    4
    Views:
    2,035
    Clifford W. Racz
    Feb 13, 2004
  3. Benjamin Niemann

    Validating SGML parser?

    Benjamin Niemann, Aug 21, 2004, in forum: Python
    Replies:
    2
    Views:
    361
    Benjamin Niemann
    Aug 22, 2004
  4. Zach Dennis

    HTML-Parser / SGML-Parser

    Zach Dennis, Oct 1, 2003, in forum: Ruby
    Replies:
    5
    Views:
    408
    Bernard Delmée
    Oct 1, 2003
  5. Srijayanth Sridhar
    Replies:
    0
    Views:
    98
    Srijayanth Sridhar
    May 23, 2008
Loading...

Share This Page