ODT Input: Dont crash on empty links

This commit is contained in:
Kovid Goyal 2012-01-11 15:37:25 +05:30
parent 4f58d7b6c8
commit e2d051cfc0

View File

@ -1158,7 +1158,7 @@ ol, ul { padding-left: 2em; }
""" Anchors start """
self.writedata()
href = attrs[(XLINKNS,"href")].split("|")[0]
if href[0] == "#":
if href[:1] == "#": # Changed by Kovid
href = "#" + self.get_anchor(href[1:])
self.opentag('a', {'href':href})
self.purgedata()