fix(attestation): delete empty paragraphs
This commit is contained in:
parent
4db4cf1513
commit
9f9720d65b
2 changed files with 2 additions and 2 deletions
|
@ -18,7 +18,7 @@ class TiptapService
|
||||||
def to_html(node, substitutions = {})
|
def to_html(node, substitutions = {})
|
||||||
return '' if node.nil?
|
return '' if node.nil?
|
||||||
|
|
||||||
children(node[:content], substitutions, 0)
|
children(node[:content], substitutions, 0).gsub('<p></p>', '')
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_texts_and_tags(node, substitutions = {})
|
def to_texts_and_tags(node, substitutions = {})
|
||||||
|
|
|
@ -171,7 +171,7 @@ RSpec.describe TiptapService do
|
||||||
'<p><s><em>Bonjour </em></s><u><strong>Paul</strong></u> <mark>!</mark></p>',
|
'<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>',
|
'<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>',
|
'<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>'
|
'<footer>Footer</footer>'
|
||||||
].join
|
].join
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue