[llvm] [Github] Improve formating of PR diffs in bot notifications (PR #66118)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 15 00:52:44 PDT 2023
================
@@ -47,6 +47,21 @@ def _get_curent_team(team_name, teams) -> Optional[github.Team.Team]:
return None
+def escape_description(str):
+ # https://github.com/github/markup/issues/1168#issuecomment-494946168
+ str = html.escape(str, False)
+ # '@' followed by alphanum is a user name
+ str = re.sub("@(?=\w+)", "@<!-- -->", str)
+ # '#' followed by digits is considered an issue number
+ str = re.sub("#(?=\d+\s)", "#<!-- -->", str)
+ return str
+
+
+def sanitize_markdown_code_block(str):
+ # remove codeblocks terminators
+ return re.sub("^\s*```\s*$", r"` ` `", str)
----------------
cor3ntin wrote:
Nope - but re-reading the spect and doing more tests, we can use more backticks instead of escaping https://spec.commonmark.org/0.30/#fenced-code-block
https://github.com/llvm/llvm-project/pull/66118
More information about the llvm-commits
mailing list