fix(narrative): render citation HTML and respect external image source
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 21s
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 21s
QuoteBlock rendered block.citation as escaped text instead of HTML, so inline markup like <em> showed as literal tags. narrative.json.php always resolved the image block's internal file field regardless of the location toggle, ignoring the external src field when location=web (unlike snippets/blocks/image.php, which already handled both cases correctly).
This commit is contained in:
parent
766ef75a6a
commit
e060dc4ad3
2 changed files with 8 additions and 3 deletions
|
|
@ -104,9 +104,14 @@ function parseBlocks($blocksField, $page) {
|
|||
break;
|
||||
|
||||
case 'image':
|
||||
$image = $block->image()->toFile();
|
||||
if ($block->location()->value() === 'web') {
|
||||
$imageUrl = $block->src()->value();
|
||||
} else {
|
||||
$image = $block->image()->toFile();
|
||||
$imageUrl = $image ? $image->url() : null;
|
||||
}
|
||||
$blockData['content'] = [
|
||||
'url' => $image ? $image->url() : null,
|
||||
'url' => $imageUrl,
|
||||
'alt' => $block->alt()->value() ?? '',
|
||||
'caption' => $block->caption()->value() ?? '',
|
||||
'width' => $block->width()->value() ?? '100%',
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<blockquote class="block-quote">
|
||||
<div v-html="content.text"></div>
|
||||
<cite v-if="content.citation">{{ content.citation }}</cite>
|
||||
<cite v-if="content.citation" v-html="content.citation"></cite>
|
||||
</blockquote>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue