mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-05 10:58:34 +08:00
Refactor: reformat all code for lefthook using ruff and gofmt (#16585)
This commit is contained in:
@@ -63,11 +63,11 @@ def clean_markdown_block(text):
|
||||
"""
|
||||
# Remove opening ```Markdown tag with optional whitespace and newlines
|
||||
# Matches: optional whitespace + ```markdown + optional whitespace + optional newline
|
||||
text = re.sub(r'^\s*```markdown\s*\n?', '', text)
|
||||
text = re.sub(r"^\s*```markdown\s*\n?", "", text)
|
||||
|
||||
# Remove closing ``` tag with optional whitespace and newlines
|
||||
# Matches: optional newline + optional whitespace + ``` + optional whitespace at end
|
||||
text = re.sub(r'\n?\s*```\s*$', '', text)
|
||||
text = re.sub(r"\n?\s*```\s*$", "", text)
|
||||
|
||||
# Return text with surrounding whitespace removed
|
||||
return text.strip()
|
||||
|
||||
Reference in New Issue
Block a user