FIX update chapter index title and anchor handling to retain original values without additional sanitization
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
af4671f917
commit
8537978301
|
|
@ -196,8 +196,8 @@ function build_page_chapter_index($blocks)
|
|||
if ($block['blockName'] == 'homegrade-content-blocks/content-heading' && isset($block['attrs']['title']) && isset($block['attrs']['headingLevel']) && $block['attrs']['headingLevel'] == "h2") {
|
||||
array_push($chapterBlockIndex, [
|
||||
'block-type' => $block['blockName'],
|
||||
'anchor' => "#" . preg_replace('/[^a-zA-Z0-9-]/', '', strip_tags($block['attrs']['idName'])), // remove html tags all non-alphanumeric characters except dashes
|
||||
'title' => preg_replace('/[^a-zA-Z0-9\s-]/', '', strip_tags($block['attrs']['title'])), // remove html tags all non-alphanumeric characters except dashes
|
||||
'anchor' => "#" . $block['attrs']['idName'],
|
||||
'title' => $block['attrs']['title'],
|
||||
]);
|
||||
}
|
||||
if ($block['blockName'] == 'homegrade-content-blocks/chapitrage-thematique') {
|
||||
|
|
@ -255,7 +255,7 @@ function build_page_chapter_index($blocks)
|
|||
array_push($chapterBlockIndex, [
|
||||
'block-type' => $block['blockName'],
|
||||
'anchor' => "#partenaires-autres-services",
|
||||
'title' => __("Partenaires & autres services", "homegrade-blocks__texte-fonctionnel"),
|
||||
'title' => __("Partenaires & autres services", "homegrade-blocks__texte-fonctionnel"),
|
||||
]);
|
||||
}
|
||||
if ($block['blockName'] == 'homegrade-content-blocks/plus-loin') {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user