independant elements from p + delete p from li
This commit is contained in:
parent
048a1b67e6
commit
c321a17f3e
8 changed files with 36 additions and 19 deletions
|
|
@ -107,10 +107,10 @@ h2{
|
|||
h5{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}*/
|
||||
.marker-title img{
|
||||
width: 40px;
|
||||
} */
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
1772466016
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.4 MiB After Width: | Height: | Size: 1.5 MiB |
|
|
@ -1 +1 @@
|
|||
Uuid: eozkssgjffkkux34
|
||||
Uuid: rbrttd19ethtb0ue
|
||||
0
public/site/cache/index.html
vendored
0
public/site/cache/index.html
vendored
|
|
@ -22,6 +22,13 @@ function resolveFileUrl($field, $page) {
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Supprime les <p> imbriqués dans les <li> (générés par Kirby pour les listes "loose")
|
||||
*/
|
||||
function stripParagraphsInListItems($html) {
|
||||
return preg_replace('/<li>\s*<p>(.*?)<\/p>\s*<\/li>/s', '<li>$1</li>', $html);
|
||||
}
|
||||
|
||||
/**
|
||||
* Résout les images dans le contenu HTML
|
||||
*/
|
||||
|
|
@ -63,7 +70,7 @@ function parseBlocks($blocksField, $page) {
|
|||
switch ($block->type()) {
|
||||
case 'text':
|
||||
$blockData['content'] = [
|
||||
'text' => resolveImagesInHtml($block->text()->value(), $page)
|
||||
'text' => stripParagraphsInListItems(resolveImagesInHtml($block->text()->value(), $page))
|
||||
];
|
||||
break;
|
||||
|
||||
|
|
@ -87,7 +94,7 @@ function parseBlocks($blocksField, $page) {
|
|||
|
||||
case 'list':
|
||||
$blockData['content'] = [
|
||||
'text' => $block->text()->value()
|
||||
'text' => stripParagraphsInListItems($block->text()->value())
|
||||
];
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue