[Python-bugs-list] [ python-Bugs-736659 ] markupbase parse_declaration cannot recognize comments

SourceForge.net noreply@sourceforge.net
Mon, 12 May 2003 13:34:28 -0700


Bugs item #736659, was opened at 2003-05-12 16:34
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=736659&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jim Jewett (jimjjewett)
Assigned to: Nobody/Anonymous (nobody)
Summary: markupbase parse_declaration cannot recognize comments

Initial Comment:

In markupbase class parser method parse_declaration

It verfies that the first two characters are "<!"

Then it returns -1 if the next character is "-".

After that, it checks to see if the next two characters 
are "--", but if they were, it would already have returned.

Solution:  Check for comments before checking for a 
short buffer.

        if rawdata[j:j+1] == '--': #comment
            # Locate --.*-- as the body of the comment
            return self.parse_comment(i)
        if rawdata[j:j+1] in ("-", ""):
            # Start of comment followed by buffer 
            # boundary, or just a buffer boundary.
            return -1


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=736659&group_id=5470