feat: support image height in markdown rendering of messages (#8177)

- This PR adds BaseMarkdownRenderer, it takes all the required attributes from the image node, parses the cw_image_height query and renders it.
This commit is contained in:
Shivam Mishra
2023-11-03 02:21:54 +05:30
committed by GitHub
parent 16c36a78f0
commit 36b6c0cb9c
4 changed files with 78 additions and 1 deletions

View File

@@ -4,7 +4,9 @@ class ChatwootMarkdownRenderer
end
def render_message
html = CommonMarker.render_html(@content)
markdown_renderer = BaseMarkdownRenderer.new
doc = CommonMarker.render_doc(@content, :DEFAULT)
html = markdown_renderer.render(doc)
render_as_html_safe(html)
end