Edgewall Software

Ticket #235: Genshi-0.6-lang.patch

File Genshi-0.6-lang.patch, 1.1 KB (added by Bjorn@…, 4 years ago)

I propose this patch.

  • genshi/output.py

    old new  
    347347                for attr, value in attrib:
    348348                    if attr in boolean_attrs:
    349349                        value = attr
    350                     elif attr == 'xml:lang' and 'lang' not in attrib:
    351                         buf += [' lang="', escape(value), '"']
    352350                    elif attr == 'xml:space':
    353351                        continue
    354352                    buf += [' ', attr, '="', escape(value), '"']
  • genshi/tests/output.py

    old new  
    226226    def test_xml_lang(self):
    227227        text = '<p xml:lang="en">English text</p>'
    228228        output = XML(text).render(XHTMLSerializer, encoding=None)
    229         self.assertEqual('<p lang="en" xml:lang="en">English text</p>', output)
     229        self.assertEqual('<p xml:lang="en">English text</p>', output)
    230230
    231231    def test_xml_lang_nodup(self):
    232232        text = '<p xml:lang="en" lang="en">English text</p>'