feat: Shows Youtube and Vimeo links as embeds [cw-1393] (#7330)

This change will render the youbtube, vimeo and .mp4 urls as embedded in the article page in the help centre.

Fixes: https://linear.app/chatwoot/issue/CW-1393/help-center-support-video-upload-in-articles

Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
Nithin David Thomas
2023-06-21 20:28:28 +05:30
committed by GitHub
parent 595e6e79f0
commit e6a49b5800
6 changed files with 215 additions and 83 deletions

View File

@@ -9,9 +9,9 @@ class ChatwootMarkdownRenderer
end
def render_article
superscript_renderer = SuperscriptRenderer.new
markdown_renderer = CustomMarkdownRenderer.new
doc = CommonMarker.render_doc(@content, :DEFAULT)
html = superscript_renderer.render(doc)
html = markdown_renderer.render(doc)
render_as_html_safe(html)
end