Edgewall Software

Ticket #368: genshi_HTML_PI.diff

File genshi_HTML_PI.diff, 627 bytes (added by Neil Muller, 11 years ago)

Accept empty data in processing instructions in HTMLParser

  • genshi/input.py

     
    401401        self._enqueue(TEXT, text)
    402402
    403403    def handle_pi(self, data):
    404         target, data = data.split(None, 1)
    405404        if data.endswith('?'):
    406405            data = data[:-1]
     406        try:
     407            target, data = data.split(None, 1)
     408        except ValueError:
     409            # PI with no data
     410            target = data
     411            date = ''
    407412        self._enqueue(PI, (target.strip(), data.strip()))
    408413
    409414    def handle_comment(self, text):