From 8ddf722c5f3a8b90b6cc6767f8ea48e55c77a628 Mon Sep 17 00:00:00 2001 From: Kevin Pearson Date: Wed, 11 Sep 2024 08:23:59 -0700 Subject: [PATCH] fix: Expand contents with toc is expanded --- languages/markdown/templates/sections/private-events.md | 2 +- languages/markdown/templates/sections/private-methods.md | 2 +- src/macrofier/engine.mjs | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/languages/markdown/templates/sections/private-events.md b/languages/markdown/templates/sections/private-events.md index 6e275023..677c317e 100644 --- a/languages/markdown/templates/sections/private-events.md +++ b/languages/markdown/templates/sections/private-events.md @@ -1,5 +1,5 @@ ## Private Events -
+
View ${event.list} diff --git a/languages/markdown/templates/sections/private-methods.md b/languages/markdown/templates/sections/private-methods.md index 9d3eb565..3da04445 100644 --- a/languages/markdown/templates/sections/private-methods.md +++ b/languages/markdown/templates/sections/private-methods.md @@ -1,5 +1,5 @@ ## Private Methods -
+
View ${method.list} diff --git a/src/macrofier/engine.mjs b/src/macrofier/engine.mjs index f8e7cffb..8ae9b67c 100644 --- a/src/macrofier/engine.mjs +++ b/src/macrofier/engine.mjs @@ -745,7 +745,8 @@ function insertTableofContents(content) { const link = '#' + slug + (count[slug] ? `-${count[slug]}` : '') toc += ' ' + ' '.repeat(level - 1) + `- [${title}](${link})` if (title === 'Private Methods' || title === 'Private Events') { - toc += '
Show\n' + let anchor = title === 'Private Methods' ? 'private-methods-details' : 'private-events-details' + toc += '
Show\n' collapsedContentLevel = level } else { toc += '\n'