mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-08-29 15:15:03 +02:00
Fix slack formatting bug (#4587)
This commit is contained in:
@@ -88,7 +88,7 @@ def _split_text(text: str, limit: int = 3000) -> list[str]:
|
||||
|
||||
def _clean_markdown_link_text(text: str) -> str:
|
||||
# Remove any newlines within the text
|
||||
return text.replace("\n", " ").strip()
|
||||
return format_slack_message(text).replace("\n", " ").strip()
|
||||
|
||||
|
||||
def _build_qa_feedback_block(
|
||||
|
@@ -3,8 +3,7 @@ from mistune import Renderer # type: ignore
|
||||
|
||||
|
||||
def format_slack_message(message: str | None) -> str:
|
||||
renderer = Markdown(renderer=SlackRenderer())
|
||||
return renderer.render(message)
|
||||
return Markdown(renderer=SlackRenderer()).render(message)
|
||||
|
||||
|
||||
class SlackRenderer(Renderer):
|
||||
|
Reference in New Issue
Block a user