Skip to content

Commit

Permalink
Fix pandoc export crashes is project title is empty
Browse files Browse the repository at this point in the history
Fixes #535
  • Loading branch information
gedakc committed May 22, 2019
1 parent f1baab8 commit 7eebe7e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion manuskript/exporter/pandoc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ def convert(self, src, args, outputfile=None):
args.append("--variable={}:{}".format(var, item.text().strip()))

# Add title metatadata required for pandoc >= 2.x
args.append("--metadata=title:{}".format(mainWindow().mdlFlatData.item(0, 0).text().strip()))
title = " " # blank prevents args.append() crash if no project title
if mainWindow().mdlFlatData.item(0, 0):
title = mainWindow().mdlFlatData.item(0, 0)
args.append("--metadata=title:{}".format(title.text().strip()))

qApp.setOverrideCursor(QCursor(Qt.WaitCursor))

Expand Down

0 comments on commit 7eebe7e

Please sign in to comment.