Browse Source

WIP: Remove divs and replace with spans in inline citations.

csl
Alexander O'Neill 6 years ago
parent
commit
8ef836efad
  1. 15
      bibcite_footnotes.module
  2. 6
      css/reference_footnote.css

15
bibcite_footnotes.module

@ -317,3 +317,18 @@ function bibcite_footnotes_get_ckeditor_select_item($entity): array {
$citation_key = $entity->id->first()->getValue()['value'];
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();
}

6
css/reference_footnote.css

@ -8,3 +8,9 @@
content: " ";
white-space: pre;
}
.bibcite-citation,
.csl-entry,
.footnote-list .footnotes .footnote-link,
.footnote-list .footnotes .footnote-multi {
display: inline;
}
Loading…
Cancel
Save