mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 02:41:13 +08:00
Various GitHub Onebox improvements (#13163)
* FIX: Improve GitHub folder regexp in Onebox It used to match any GitHub URL that was not matched by the other GitHub Oneboxes and it did not do a good job at handling those. With this change, the generic Onebox will handle the remaining URLs. * FEATURE: Add Onebox for GitHub Actions * FEATURE: Add Onebox for PR check runs * FIX: Remove image from GitHub folder Oneboxes It is a generic, auto-generated image which does not provide any value. * DEV: Add tests * FIX: Strip HTML comments from PR body
This commit is contained in:
@ -7,14 +7,9 @@ module Onebox
|
||||
include StandardEmbed
|
||||
include LayoutSupport
|
||||
|
||||
matches_regexp(/^https?:\/\/(?:www\.)?(?:(?:\w)+\.)?(github)\.com[\:\d]*(\/[^\/]+){2}/)
|
||||
matches_regexp(/^https?:\/\/(?:www\.)?(?:(?:\w)+\.)?(github)\.com[\:\d]*(\/[^\/]+){2}\/tree/)
|
||||
always_https
|
||||
|
||||
def self.priority
|
||||
# This engine should have lower priority than the other Github engines
|
||||
150
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def data
|
||||
@ -46,7 +41,6 @@ module Onebox
|
||||
|
||||
{
|
||||
link: url,
|
||||
image: og.image,
|
||||
title: Onebox::Helpers.truncate(title, 250),
|
||||
path: display_path,
|
||||
description: display_description,
|
||||
|
Reference in New Issue
Block a user