Fix divide by zero error on chapters with no content.

This commit is contained in:
asbjorn grandt 2014-02-02 00:55:34 +01:00
parent d398b62c1a
commit 250121e137

View file

@ -137,6 +137,9 @@ def replace_br_with_p(body):
contentLinesSum += lineLen
if lineLen > longestLineLength:
longestLineLength = lineLen
if contentLines == 0:
contentLines = 1
averageLineLength = contentLinesSum/contentLines