Update CrossDown.py

修改了段落
This commit is contained in:
跨越晨昏 2024-08-29 18:00:05 +08:00 committed by GitHub
parent e5cae2491f
commit fb7f3f1614
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -176,8 +176,8 @@ class CodeBlock:
class Basic:
@staticmethod
def paragraph(text: str):
text = '\n'.join(['-' + line + '-' for line in original_string.splitlines()])
return re.sub(r'(<.+?>.*?<.+?>)\n', r'<p>\1</p>\n', text)
text = '\n'.join([f'<p>{line}</p>' for line in original_string.splitlines()])
return re.sub(r'<p>(<.+?>.*?<.+?>)</p>\n', r'\1\n', text)
def add_indent_to_string(input_string: str, indent_spaces: int = 4):