From 797d450b73370b38e3a2f1f1703e8f48948aea90 Mon Sep 17 00:00:00 2001 From: Vinoth Kannan Date: Sat, 2 Nov 2019 17:31:38 +0530 Subject: [PATCH] FIX: keep onebox body content in post excerpts for schema data. --- plugin.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.rb b/plugin.rb index affceab..a26ab17 100644 --- a/plugin.rb +++ b/plugin.rb @@ -248,7 +248,7 @@ SQL question_json = { '@type' => 'Question', 'name' => topic.title, - 'text' => first_post.excerpt, + 'text' => first_post.excerpt(nil, keep_onebox_body: true), 'upvoteCount' => first_post.like_count, 'answerCount' => 0, 'dateCreated' => topic.created_at, @@ -262,7 +262,7 @@ SQL question_json['answerCount'] = 1 question_json[:acceptedAnswer] = { '@type' => 'Answer', - 'text' => accepted_answer.excerpt, + 'text' => accepted_answer.excerpt(nil, keep_onebox_body: true), 'upvoteCount' => accepted_answer.like_count, 'dateCreated' => accepted_answer.created_at, 'url' => accepted_answer.full_url,