Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

widgets: Fix bug where a new line right after /todo broke rendering.

N-Shar-ma8c91c91d865e
diff --git a/zerver/lib/widget.py b/zerver/lib/widget.py
index 2eabedf08c2..e8abb156493 100644
--- a/zerver/lib/widget.py
+++ b/zerver/lib/widget.py
@@ -8,7 +8,7 @@ from zerver.models import Message, SubMessage
def get_widget_data(content: str) -> Tuple[Optional[str], Optional[str]]:
valid_widget_types = ["poll", "todo"]
- tokens = content.split(" ")
+ tokens = re.split(r"\s+|\n+", content)
# tokens[0] will always exist
if tokens[0].startswith("/"):