Skip to content

Commit

Permalink
!!! FEATURE: link back to footnote
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaip authored May 23, 2019
1 parent c18e1cb commit 9731b88
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Resources/Private/Fusion/Root.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ prototype(Psmb.Footnote:FootnoteProcessor) < prototype(Neos.Fusion:Array) {
@if.notInBackend = ${!documentNode.context.inBackend}
pattern = ${'/<span data-footnote="(.*?)">(.*?)<\/span>/'}
subject = ${value}
replacementRenderer = ${matches[2] + '<sup><a href="#footnote_' + iterator.cycle + '">' + iterator.cycle + '</a></sup>'}
replacementRenderer = ${matches[2] + '<sup class="footnote" id="footnoteSource_' + iterator.cycle + '"><a href="#footnote_' + iterator.cycle + '">' + iterator.cycle + '</a></sup>'}
}
}
footnotes = Neos.Fusion:Collection {
@process.wrap = ${value && '<ol>' + value + '</ol>'}
@if.live = ${node.context.workspaceName == 'live'}
@process.wrap = ${value && '<ul class="footnoteList">' + value + '</ul>'}
collection = Psmb.Footnote:PregMatchAll {
pattern = ${'/<span data-footnote="(.*?)">(.*?)<\/span>/'}
subject = ${value}
}
itemName = 'item'
itemRenderer = ${'<li id="footnote_' + iterator.cycle + '">' + item[1] + '</li>'}
itemRenderer = ${'<li class="footnoteList-item" id="footnote_' + iterator.cycle + '"><a href="#footnoteSource_' + iterator.cycle + '"><sup>' + iterator.cycle + '</sup></a> ' + item[1] + '</li>'}
}
}

0 comments on commit 9731b88

Please sign in to comment.