Skip to content

Commit

Permalink
Fix Invalid html structure in caption component (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
iRohitSingh authored Jun 28, 2024
1 parent 03bb7aa commit 1c0353a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/volto-light-theme/news/398.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix Invalid html structure in caption component @iRohitSingh
5 changes: 2 additions & 3 deletions packages/volto-light-theme/src/components/Caption/Caption.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@ import PropTypes from 'prop-types';
*/
const Caption = ({ as = 'figcaption', title, description, credit }) => {
const As = as;

return (
<As>
{title && <h2 className="title">{title}</h2>}
{description && (
<p className="description">
<div className="description">
{description.split('\n').map((line, index) => (
<p key={index}>{line || '\u00A0'}</p>
))}
</p>
</div>
)}
{credit && <p className="credits">{credit}</p>}
</As>
Expand Down

0 comments on commit 1c0353a

Please sign in to comment.