Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion htmldocx/h2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,10 @@ def handle_starttag(self, tag, attrs):
self.tags['list'].append(tag)
return # don't apply styles for now
elif tag == 'br':
self.run.add_break()
try:
self.run.add_break()
except AttributeError: #If <br> is the first element parsed, self.run will not be defined
self.doc.add_paragraph()
return

self.tags[tag] = current_attrs
Expand Down