fix(attestation): delete empty paragraphs

This commit is contained in:
Colin Darie 2024-09-04 15:04:07 +02:00
parent 4db4cf1513
commit 9f9720d65b
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
2 changed files with 2 additions and 2 deletions

View file

@ -18,7 +18,7 @@ class TiptapService
def to_html(node, substitutions = {})
return '' if node.nil?
children(node[:content], substitutions, 0)
children(node[:content], substitutions, 0).gsub('<p></p>', '')
end
def to_texts_and_tags(node, substitutions = {})

View file

@ -171,7 +171,7 @@ RSpec.describe TiptapService do
'<p><s><em>Bonjour </em></s><u><strong>Paul</strong></u> <mark>!</mark></p>',
'<ul><li><p>Item 1</p></li><li><p>Item 2</p></li></ul>',
'<ol><li><p>Item 1</p></li><li><p>Item 2</p></li></ol>',
'<p>Langages de prédilection:</p><ul><li><p>ruby</p></li><li><p>rust</p></li></ul><p></p>', # TODO: remove empty <p> ?
'<p>Langages de prédilection:</p><ul><li><p>ruby</p></li><li><p>rust</p></li></ul>',
'<footer>Footer</footer>'
].join
end