From 8ef836efadaec131f058e52d291727747a1bd544 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Tue, 2 Apr 2019 23:09:23 -0300 Subject: [PATCH] WIP: Remove divs and replace with spans in inline citations. --- bibcite_footnotes.module | 15 +++++++++++++++ css/reference_footnote.css | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/bibcite_footnotes.module b/bibcite_footnotes.module index b9585c5..dfc81de 100644 --- a/bibcite_footnotes.module +++ b/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(); +} \ No newline at end of file diff --git a/css/reference_footnote.css b/css/reference_footnote.css index 2529217..4f5af2e 100644 --- a/css/reference_footnote.css +++ b/css/reference_footnote.css @@ -7,4 +7,10 @@ .footnote-list .footnotes .footnote-multi::after { content: " "; white-space: pre; +} +.bibcite-citation, +.csl-entry, +.footnote-list .footnotes .footnote-link, +.footnote-list .footnotes .footnote-multi { + display: inline; } \ No newline at end of file