https://github.com/user-attachments/assets/fc4d15f9-2b54-4627-940f-94772ec739b1 --------- Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com> Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
8 lines
371 B
Ruby
8 lines
371 B
Ruby
content = ChatwootMarkdownRenderer.new(article.content.to_s).render_markdown_to_plain_text.squish
|
|
snippet = excerpt(content, search_query, radius: 110, omission: '...') ||
|
|
truncate(content, length: 220, separator: ' ')
|
|
|
|
json.extract! article, :id, :category_id, :title
|
|
json.content snippet
|
|
json.link generate_article_link(portal_slug, article.slug, nil, false)
|