FEATURE: Small improvements to the topic list embed (#12881)

* FEATURE: Small improvements to the topic list embed

- Ability to wrap the list in a custom class so you can styles different
lists using specific CSS

- Adds a topic link to the thumbnail when using the complete template

* FIX: Be more strict about allowed chars in class name
This commit is contained in:
Rafael dos Santos Silva
2021-04-29 12:12:00 -03:00
committed by GitHub
parent 15eabb1d97
commit e2154b3d59
3 changed files with 19 additions and 3 deletions

View File

@ -34,6 +34,10 @@ class EmbedController < ApplicationController
raise Discourse::InvalidParameters.new(:embed_id) unless @embed_id =~ /^de\-[a-zA-Z0-9]+$/
end
if @embed_class = params[:embed_class]
raise Discourse::InvalidParameters.new(:embed_class) unless @embed_class =~ /^[a-zA-Z0-9\-_]+$/
end
if params.has_key?(:template) && params[:template] == "complete"
@template = "complete"
else