From 52e7f8d80383ea1a9ac57cc503512e410c7bf8bd Mon Sep 17 00:00:00 2001 From: tobiju Date: Sat, 29 Jul 2017 20:46:57 +0200 Subject: [PATCH] Fix toc indent with level larger 4 --- templates/helper.php | 4 ++-- templates/style.php | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/templates/helper.php b/templates/helper.php index 4b47a96..6360875 100644 --- a/templates/helper.php +++ b/templates/helper.php @@ -14,13 +14,13 @@ function renderTocList(array $elements, Aura\View\View $context) foreach ($elements as $entry) { $entryObj = new Bookdown\Bookdown\Content\Heading($entry['number'], $entry['title'], $entry['href'], $entry['id']); - echo '
  • '; + echo '
  • '; echo '
    '; echo '
    ' . '' . "{$entryObj->getNumber()}" . '
    '; echo '
    ' . $context->anchorRaw($entryObj->getHref(), $entryObj->getTitle()) . '
    '; echo '
    '; if (isset($entry['nested'])) { - $collapseId = 'collapse-' . $entryObj->getAnchor(); + $collapseId = 'collapse-' . str_replace('.','-', trim($entryObj->getNumber(),'.')); echo ''; echo '