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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ToC levels for not autogenerated ToC are not honored #178

Closed
xorguy opened this issue Apr 16, 2024 · 3 comments
Closed

ToC levels for not autogenerated ToC are not honored #178

xorguy opened this issue Apr 16, 2024 · 3 comments

Comments

@xorguy
Copy link

xorguy commented Apr 16, 2024

Hi.

I tend to use an automated table of contents using "Markdown All in One" for VSCode, because it allows me browsing the document from within the document.

The problem is that when it is served with madness the levels are not respected but using the automatic ToC generator from madness it creates the correct levels.

As an example I have as a manual ToC:

- [first level](#first-level)
  - [second level](#second-level)
    - [third level](#third-level)

But once is served by madness I only get:

· first level
    · second level
    · third level

So only two levels are shown.

I know I can use the TOC generator but then I lose the ability to use a visible ToC while editing.

@xorguy xorguy changed the title Levels on TOC not autogenerated ToC levels for not autogenerated ToC are not honored Apr 16, 2024
@DannyBen
Copy link
Owner

DannyBen commented Apr 16, 2024

Thanks for the report. I can confirm it seems like a bug in the redcarpet markdown engine.

I found these similar issues:

I added a simple reproduction case comment to the thread.

At this point, there is not much I can do about it, other than try to move to a different markdown renderer.

In the past, madness used RDiscount and CommonMarker - both had more issues than redcarpet.
The only markdown renderer for Ruby I haven't tried in madness is Kramdown.

@DannyBen
Copy link
Owner

Version 1.2.0 is now released with support for pandoc as an alternative markdown renderer. When using renderer: pandoc in .madness.yml settings, nested lists should render properly.

Note that this requires having pandoc installed, but it should be as simple as brew install pandoc or any other OS package manager (apt / apk etc).

If you can confirm this works, or report that it doesn't, it will be appreciated.

@xorguy
Copy link
Author

xorguy commented Apr 18, 2024

Hi. Updated docker container and set pandoc renderer and now the levels on a manually created ToC, not auto-ToC, are correctly rendered.

Thanks!

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

No branches or pull requests

2 participants