A platform for community discussion. Free, open, simple.
UX: Strip multiline comments in github oneboxes (#30040)
David Taylorb47ae6d43718
diff --git a/lib/onebox/engine/github_pull_request_onebox.rb b/lib/onebox/engine/github_pull_request_onebox.rbindex 3ddb048d52e..5ade5ed018c 100644--- a/lib/onebox/engine/github_pull_request_onebox.rb+++ b/lib/onebox/engine/github_pull_request_onebox.rb@@ -12,8 +12,6 @@ module Oneboxinclude Onebox::Mixins::GithubBodyinclude Onebox::Mixins::GithubAuthHeader- GITHUB_COMMENT_REGEX = /(<!--.*?-->\r\n)/-matches_regexp(%r{^https?://(?:www\.)?(?:(?:\w)+\.)?(github)\.com(?:/)?(?:.)*/pull})always_httpsdiff --git a/lib/onebox/engine/github_repo_onebox.rb b/lib/onebox/engine/github_repo_onebox.rbindex bd785606378..b80d82b3c84 100644--- a/lib/onebox/engine/github_repo_onebox.rb+++ b/lib/onebox/engine/github_repo_onebox.rb@@ -11,7 +11,7 @@ module Oneboxinclude JSONinclude Onebox::Mixins::GithubAuthHeader- GITHUB_COMMENT_REGEX = /(<!--.*?-->\r\n)/+ GITHUB_COMMENT_REGEX = /(<!--.*?-->\r\n)/mmatches_regexp(%r{^https?:\/\/(?:www\.)?(?!gist\.)[^\/]*github\.com\/[^\/]+\/[^\/]+\/?$})always_httpsdiff --git a/lib/onebox/mixins/github_body.rb b/lib/onebox/mixins/github_body.rbindex b14de31a6be..7f275099abe 100644--- a/lib/onebox/mixins/github_body.rb+++ b/lib/onebox/mixins/github_body.rb@@ -9,7 +9,7 @@ module Oneboxendmodule InstanceMethods- GITHUB_COMMENT_REGEX = /<!--.*?-->/+ GITHUB_COMMENT_REGEX = /<!--.*?-->/mMAX_BODY_LENGTH = 80def compute_body(body)