Fix: paragraph format

This commit is contained in:
Kujiu 2021-01-31 13:09:28 +01:00
parent 0800969c39
commit 497edf0e1e
Signed by: kujiu
GPG key ID: ABBB2CAC6855599F

View file

@ -459,7 +459,8 @@ class GeminiTranslator(SphinxTranslator):
self.add_text(':')
def depart_field_name(self, node: Element) -> None:
self.add_text(': ')
self.add_text(':')
self.end_block()
def visit_field_body(self, node: Element) -> None:
pass
@ -682,7 +683,11 @@ class GeminiTranslator(SphinxTranslator):
raise nodes.SkipNode
def visit_Text(self, node: Text) -> None:
self.add_text(node.astext())
text = node.astext()
if isinstance(node.parent, nodes.paragraph):
text = text.replace('\r', '')
text = text.replace('\n', ' ')
self.add_text(text)
def depart_Text(self, node: Text) -> None:
pass