|
|
@ -317,3 +317,18 @@ function bibcite_footnotes_get_ckeditor_select_item($entity): array { |
|
|
|
$citation_key = $entity->id->first()->getValue()['value']; |
|
|
|
$citation_key = $entity->id->first()->getValue()['value']; |
|
|
|
return [$citation_text, $citation_key]; |
|
|
|
return [$citation_text, $citation_key]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function _bibcite_footnotes_replace_divs_with_spans(string $html) { |
|
|
|
|
|
|
|
$Dom = new DOMDocument(); |
|
|
|
|
|
|
|
$Dom->loadHTML($html); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($Dom->getElementsByTagName('div') as $Ele) { |
|
|
|
|
|
|
|
$New = $Dom->createElement('span', $Ele->nodeValue); |
|
|
|
|
|
|
|
$New->setAttribute('id', $Ele->getAttribute('id')); |
|
|
|
|
|
|
|
$Parent = $Ele->parentNode; |
|
|
|
|
|
|
|
$Parent->removeChild($Ele); |
|
|
|
|
|
|
|
$Parent->appendChild($New); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return $Dom->saveHTML(); |
|
|
|
|
|
|
|
} |