You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When strip_html is passed string containing multiple paragaphs (eg by rdm-records' ui serialiser), entries with multiple paragraphs are concatenated without spacing. This looks poor and reduces readability.
Steps to Reproduce
See screenshots below (from Invenio RDM), or:
In [3]: strip_html('<p>a</p><p>b</p>')
Out[3]: 'ab'
Expected behaviour
A single space should be inserted between the paragraphs content to ensure the stripped description is readable, ie:
In [3]: strip_html('<p>a</p><p>b</p>')
Out[3]: 'a b'
Screenshots (if applicable)
Invenio RDM record description with 2 paragraphs:
Renders in search without space between paragraphs:
Additional context
I have made a local workaround that inserts a space after any paragraph closing tag before calling strip_html. Perhaps
a proper fix would use html.parse to pass the description to strip_html 1 paragraph at a time? Happy to give that a go if it seems sensible.
The text was updated successfully, but these errors were encountered:
Package version (if known): all
Describe the bug
When strip_html is passed string containing multiple paragaphs (eg by rdm-records' ui serialiser), entries with multiple paragraphs are concatenated without spacing. This looks poor and reduces readability.
Steps to Reproduce
See screenshots below (from Invenio RDM), or:
Expected behaviour
A single space should be inserted between the paragraphs content to ensure the stripped description is readable, ie:
Screenshots (if applicable)
Invenio RDM record description with 2 paragraphs:
Renders in search without space between paragraphs:
Additional context
I have made a local workaround that inserts a space after any paragraph closing tag before calling strip_html. Perhaps
a proper fix would use html.parse to pass the description to strip_html 1 paragraph at a time? Happy to give that a go if it seems sensible.
The text was updated successfully, but these errors were encountered: