FIX: keep onebox body content in post excerpts for schema data.

This commit is contained in:
Vinoth Kannan 2019-11-02 17:31:38 +05:30
parent e974c35d38
commit 797d450b73

View File

@ -248,7 +248,7 @@ SQL
question_json = { question_json = {
'@type' => 'Question', '@type' => 'Question',
'name' => topic.title, 'name' => topic.title,
'text' => first_post.excerpt, 'text' => first_post.excerpt(nil, keep_onebox_body: true),
'upvoteCount' => first_post.like_count, 'upvoteCount' => first_post.like_count,
'answerCount' => 0, 'answerCount' => 0,
'dateCreated' => topic.created_at, 'dateCreated' => topic.created_at,
@ -262,7 +262,7 @@ SQL
question_json['answerCount'] = 1 question_json['answerCount'] = 1
question_json[:acceptedAnswer] = { question_json[:acceptedAnswer] = {
'@type' => 'Answer', '@type' => 'Answer',
'text' => accepted_answer.excerpt, 'text' => accepted_answer.excerpt(nil, keep_onebox_body: true),
'upvoteCount' => accepted_answer.like_count, 'upvoteCount' => accepted_answer.like_count,
'dateCreated' => accepted_answer.created_at, 'dateCreated' => accepted_answer.created_at,
'url' => accepted_answer.full_url, 'url' => accepted_answer.full_url,