From dd0eca3e58a0d2af2a2defcd84152e6c1fbcaf9e Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Mon, 19 Jun 2017 12:38:49 +0100 Subject: [PATCH] integrations/perforce: Fix formatting of multiple paragraphs. This fixes multiple paragraphs in a commit message escaping from the block quote by using triple-backquote quoting instead of '>' which only applies to one paragraph. --- api/integrations/perforce/zulip_change-commit.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/api/integrations/perforce/zulip_change-commit.py b/api/integrations/perforce/zulip_change-commit.py index 0e39ca525b..f75eb337ce 100755 --- a/api/integrations/perforce/zulip_change-commit.py +++ b/api/integrations/perforce/zulip_change-commit.py @@ -76,11 +76,16 @@ if destination is None: # Don't forward the notice anywhere sys.exit(0) -message = "**{0}** committed revision @{1} to `{2}`.\n\n> {3}".format( - metadata["user"], - metadata["change"], - changeroot, - metadata["desc"]) # type: str +message = """**{user}** committed revision @{change} to `{path}`. + +```quote +{desc} +``` +""".format( + user=metadata["user"], + change=metadata["change"], + path=changeroot, + desc=metadata["desc"]) # type: str message_data = { "type": "stream",