Handle empty titles
This commit is contained in:
parent
3f764d6466
commit
50aab3005c
@ -237,7 +237,7 @@ def reconstitute(feed, entry):
|
||||
links(xentry, entry)
|
||||
|
||||
bozo = feed.bozo
|
||||
if not entry.has_key('title'):
|
||||
if not entry.has_key('title') or not entry.title:
|
||||
xentry.appendChild(xdoc.createElement('title'))
|
||||
|
||||
content(xentry, 'title', entry.get('title_detail',None), bozo)
|
||||
|
10
tests/data/reconstitute/empty_title.xml
Normal file
10
tests/data/reconstitute/empty_title.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<!--
|
||||
Description: empty title
|
||||
Expect: title_detail.value == ''
|
||||
-->
|
||||
|
||||
<feed xmns="http://www.w3.org/2005/Atom">
|
||||
<entry>
|
||||
<title/>
|
||||
</entry>
|
||||
</feed>
|
9
tests/data/reconstitute/missing_title.xml
Normal file
9
tests/data/reconstitute/missing_title.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<!--
|
||||
Description: missing title
|
||||
Expect: title_detail.value == ''
|
||||
-->
|
||||
|
||||
<feed xmns="http://www.w3.org/2005/Atom">
|
||||
<entry>
|
||||
</entry>
|
||||
</feed>
|
Loading…
Reference in New Issue
Block a user