From 60a15bbe721f23ec05093107da6cb3056d158c90 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 6 Jan 2025 11:04:01 -0500 Subject: Remove style blocks from OG summaries --- app/controllers/blogs_controller.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app/controllers/blogs_controller.rb') diff --git a/app/controllers/blogs_controller.rb b/app/controllers/blogs_controller.rb index 033d6bb..4f6d9ce 100644 --- a/app/controllers/blogs_controller.rb +++ b/app/controllers/blogs_controller.rb @@ -1,5 +1,11 @@ require 'redcarpet/render_strip' +class StrippedSummary < Redcarpet::Render::StripDown + def block_html(raw_html) + nil + end +end + class BlogsController < ApplicationController def summary @@ -27,7 +33,7 @@ class BlogsController < ApplicationController @prev = @blog.prev @next = @blog.next - body = Redcarpet::Markdown.new(Redcarpet::Render::StripDown).render(@blog.body) + body = Redcarpet::Markdown.new(StrippedSummary).render(@blog.body) set_meta_tags(og: { title: @blog.title, -- cgit 1.4.1