Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: error when post is plain text without titles #15

Merged
merged 1 commit into from
Jul 20, 2023

Conversation

manueldeprada
Copy link
Contributor

@manueldeprada manueldeprada commented Jul 20, 2023

Compilation fails for posts without titles or subtitles because toc.length is 0. In the condition:

  {{ if toc.length > 1 || toc[0].children.length }}

The first part is false, so the second condition is evaluated. However, this fails because toc[0] is undefined. Therefore, it is necessary to check for the existence of toc[0].

Thanks for the 馃敟 馃敟 !!

@oscarotero oscarotero merged commit c52b14d into lumeland:main Jul 20, 2023
@oscarotero
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants