Skip to content

Commit 60a1643

Browse files
author
jburov
committed
[TASK] DIG-81 fe rendering footnotes - when rendering footnotes, consider possible HTML markup
1 parent 35892d8 commit 60a1643

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Classes/Hooks/FootnotesHook.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,14 @@ public function generateFootnotes($params, $pObj)
6666
{
6767
// init vars
6868
$patternFootnoteAnchors = '/<sup[ ]+class="t3foonote">(?:.(?!\<\/sup\>))*.<\/sup>/i';
69-
$patternDataAttrFootnoteAnchor = '/(<span[ ]+class="t3foonotes-anchor-data".*>)((?:.(?!\<\/span\>))*.)(<\/span>)/i';
69+
$patternDataAttrFootnoteAnchor = '/(<span[ ]+class="t3foonotes-anchor-data".*?>)((?:.(?!\<\/span\>))*.)(<\/span>)/i';
7070
$tempMarkerAnchor = '#########SUP#########';
7171
$patterntempMarkerAnchor = '/' . $tempMarkerAnchor . '/';
7272
$matchesFootnoteData = [];
7373
$footnotes = [];
7474

7575
$footnoteAnchors = $this->getFootnotesAnchors($patternFootnoteAnchors, $pObj);
7676

77-
7877
// if found footnotes anchors process build footnotes
7978
if ($footnoteAnchors) {
8079

@@ -91,7 +90,8 @@ public function generateFootnotes($params, $pObj)
9190
preg_match($patternDataAttrFootnoteAnchor, $footnoteAnchor, $matchesFootnoteData);
9291

9392
if (sizeof($matchesFootnoteData) == 4) {
94-
$footnotes[] = ['data' => $matchesFootnoteData[2], 'nr' => $nr];
93+
$footnoteContent = $matchesFootnoteData[2];
94+
$footnotes[] = ['data' => $footnoteContent, 'nr' => $nr];
9595
$footnoteAnchor = preg_replace($patternDataAttrFootnoteAnchor, '', $footnoteAnchor);
9696
}
9797

0 commit comments

Comments
 (0)