fix to prevent exception on empty content or summary
This commit is contained in:
parent
2bf1bd8e13
commit
7edea821f4
1 changed files with 8 additions and 5 deletions
13
nasg.py
13
nasg.py
|
@ -188,9 +188,10 @@ class MarkdownDoc(object):
|
||||||
return self._parsed[1]
|
return self._parsed[1]
|
||||||
|
|
||||||
def __pandoc(self, c):
|
def __pandoc(self, c):
|
||||||
c = Pandoc(c)
|
if c and len(c):
|
||||||
c = RE_PRECODE.sub(
|
c = Pandoc(c)
|
||||||
'<pre><code lang="\g<1>" class="language-\g<1>">', c)
|
c = RE_PRECODE.sub(
|
||||||
|
'<pre><code lang="\g<1>" class="language-\g<1>">', c)
|
||||||
return c
|
return c
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
|
@ -419,8 +420,10 @@ class Singular(MarkdownDoc):
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def html_summary(self):
|
def html_summary(self):
|
||||||
# return MD.reset().convert(self.summary)
|
c = self.summary
|
||||||
return Pandoc(self.summary)
|
if c and len(c):
|
||||||
|
c = Pandoc(self.summary)
|
||||||
|
return c
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def title(self):
|
def title(self):
|
||||||
|
|
Loading…
Reference in a new issue