Browse Source

Fix some errors when text is None

main
Kujiu 12 months ago
parent
commit
04f3997ef8
Signed by: kujiu
GPG Key ID: ABBB2CAC6855599F
  1. 5
      CHANGES
  2. 2
      setup.py
  3. 2
      sphinx_gemini_builder/__init__.py
  4. 3
      sphinx_gemini_builder/ablog_compatibility.py
  5. 4
      sphinx_gemini_builder/writer.py

5
CHANGES

@ -2,6 +2,11 @@
Changes
=======
1.1.2 (*2021-06-02*)
====================
- Fix error when text is None
1.1.1 (*2021-02-03*)
====================

2
setup.py

@ -28,7 +28,7 @@ with open("README.rst", "r") as fh:
setup(
name="sphinx_gemini_builder",
version="1.1.1",
version="1.1.2",
url="https://procrastinator.nerv-project.eu/nerv-project/sphinx_gemini_builder",
license="EUPL 1.2",
author="Kujiu",

2
sphinx_gemini_builder/__init__.py

@ -5,7 +5,7 @@
Build Gemini blog from Sphinx.
"""
__version_info__ = (1, 1, 1)
__version_info__ = (1, 1, 2)
__version__ = '.'.join([str(val) for val in __version_info__])

3
sphinx_gemini_builder/ablog_compatibility.py

@ -45,7 +45,8 @@ class Page:
self.body += '\n'
def add_raw(self, text: str) -> None:
self.body += text
if text:
self.body += text
def end_block(self) -> None:
self.body += '\n'

4
sphinx_gemini_builder/writer.py

@ -61,10 +61,10 @@ class GeminiTranslator(SphinxTranslator):
def add_text(self, text: str) -> None:
if self.table:
if len(self.cell_text):
self.cell_text[-1] += text
self.cell_text[-1] += text or ''
else:
self.cell_text.append(text)
else:
elif text:
self.body += text
def add_link(self, url: str, label: str = '') -> None:

Loading…
Cancel
Save