diff --git a/CHANGES b/CHANGES index ad13e0f..c1529f4 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,11 @@ Changes ======= +1.1.2 (*2021-06-02*) +==================== + +- Fix error when text is None + 1.1.1 (*2021-02-03*) ==================== diff --git a/setup.py b/setup.py index 066c163..008e4e2 100644 --- a/setup.py +++ b/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", diff --git a/sphinx_gemini_builder/__init__.py b/sphinx_gemini_builder/__init__.py index f9e9e48..05f826f 100644 --- a/sphinx_gemini_builder/__init__.py +++ b/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__]) diff --git a/sphinx_gemini_builder/ablog_compatibility.py b/sphinx_gemini_builder/ablog_compatibility.py index 9091e80..999aa50 100644 --- a/sphinx_gemini_builder/ablog_compatibility.py +++ b/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' diff --git a/sphinx_gemini_builder/writer.py b/sphinx_gemini_builder/writer.py index 74b21d9..930e0e0 100644 --- a/sphinx_gemini_builder/writer.py +++ b/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: