File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -2355,6 +2355,11 @@ def render_ad(
23552355 # we want to display a simple placeholder image.
23562356 image_preview_url = static ("image-placeholder.png" )
23572357
2358+ # Render old style ads where HTML was allowed
2359+ # New style ads just use headline/content/CTA
2360+ text = self .render_links (click_url or self .link )
2361+ body = html .unescape (bleach .clean (text , tags = [], strip = True ))
2362+
23582363 return template .render (
23592364 {
23602365 "ad" : self ,
@@ -2368,6 +2373,11 @@ def render_ad(
23682373 # to link the `Ads by EthicalAds` to.
23692374 "keywords" : keywords ,
23702375 "topics" : topics ,
2376+ # Pass headline, body, cta
2377+ # Newer ad formats can customize the display
2378+ "headline" : self .headline ,
2379+ "content" : self .content or body ,
2380+ "cta" : self .cta ,
23712381 }
23722382 ).strip ()
23732383
You can’t perform that action at this time.
0 commit comments