Skip to content

Commit

Permalink
Merge pull request #198 from c0nst4ntin/add-support-for-links-around-…
Browse files Browse the repository at this point in the history
…images-within-rich-text

feat: escape link target around images
  • Loading branch information
c0nst4ntin authored Nov 22, 2022
2 parents 94709c5 + 307d485 commit 228711e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Prismic/Dom/RichText.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ private static function serialize($element, $content, $linkResolver, $htmlSerial
$link = property_exists($element, 'linkTo') ? Link::asUrl($element->linkTo, $linkResolver) : null;

$target = property_exists($element, 'linkTo') ? ($element->linkTo->target ?? null) : null;
$targetCode = $target ? ' target="' . $target . '"' : '';
$targetCode = $target ? ' target="' . htmlentities($target) . '"' : '';

return (
'<p class="block-img' . (isset($element->label) ? (' ' . $element->label) : '') . '">' .
Expand Down

0 comments on commit 228711e

Please sign in to comment.