mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
FEATURE: Show more context in Discourse topic oneboxes
Currently when generating a onebox for Discourse topics, some important context is missing such as categories and tags. This patch addresses this issue by introducing a new onebox engine dedicated to display this information when available. Indeed to get this new information, categories and tags are exposed in the topic metadata as opengraph tags.
This commit is contained in:

committed by
Loïc Guitaut

parent
d2e9ea6193
commit
14d97f9cf1
@ -70,7 +70,7 @@ module CookedProcessorMixin
|
||||
found = false
|
||||
parent = img
|
||||
while parent = parent.parent
|
||||
if parent["class"] && parent["class"].include?("allowlistedgeneric")
|
||||
if parent["class"] && parent["class"].match?(/\b(allowlistedgeneric|discoursetopic)\b/)
|
||||
found = true
|
||||
break
|
||||
end
|
||||
|
Reference in New Issue
Block a user