feat: Adds support for superscript in help center articles (#7279)

- Adds support for superscript when rendering article markdown
- Chatwoot Markdown Render to render markdown everywhere

Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
Nithin David Thomas
2023-06-14 15:39:00 +05:30
committed by GitHub
parent 2e79a32db7
commit d2aa19579e
11 changed files with 159 additions and 11 deletions

View File

@@ -6,7 +6,10 @@ RSpec.describe 'Public Articles API', type: :request do
let!(:portal) { create(:portal, slug: 'test-portal', config: { allowed_locales: %w[en es] }, custom_domain: 'www.example.com') }
let!(:category) { create(:category, name: 'category', portal: portal, account_id: account.id, locale: 'en', slug: 'category_slug') }
let!(:category_2) { create(:category, name: 'category', portal: portal, account_id: account.id, locale: 'es', slug: 'category_slug') }
let!(:article) { create(:article, category: category, portal: portal, account_id: account.id, author_id: agent.id) }
let!(:article) do
create(:article, category: category, portal: portal, account_id: account.id, author_id: agent.id,
content: 'This is a *test* content with ^markdown^')
end
before do
ENV['HELPCENTER_URL'] = ENV.fetch('FRONTEND_URL', nil)
@@ -43,6 +46,7 @@ RSpec.describe 'Public Articles API', type: :request do
it 'Fetch article with the id' do
get "/hc/#{portal.slug}/articles/#{article.slug}"
expect(response).to have_http_status(:success)
expect(response.body).to include(ChatwootMarkdownRenderer.new(article.content).render_article)
expect(article.reload.views).to eq 1
end