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

Table rendering fails inside "tabbed" or "collapsible blocks" #78

Closed
yomach opened this issue Sep 24, 2024 · 2 comments
Closed

Table rendering fails inside "tabbed" or "collapsible blocks" #78

yomach opened this issue Sep 24, 2024 · 2 comments

Comments

@yomach
Copy link

yomach commented Sep 24, 2024

It seems that trying to add a table inside a tab:

=== This is a tab

    This is text

    {{ read_csv('path') }}

Or in a collapsible block:

??? Information "Block"

    This is text

    {{ read_csv('path') }}

Doesn't work... Note that I just upgraded from version 1.2, and it worked in that version (but I also upgraded other mkdocs related packages)

@yomach
Copy link
Author

yomach commented Sep 24, 2024

I just realized that this is caused by the missing indentation, fixed by adding | add_indentation(spaces=4)

@yomach yomach closed this as completed Sep 24, 2024
@timvink
Copy link
Owner

timvink commented Sep 24, 2024

Yes, glad you found it.

The indentation fix is only needed when using mkdocs-macros-plugin also. That's because it switches to using the Jinja engine, and the Jinja tags are not aware of any spacing, so don't keep them when there are newlines in the output.

More background here: fralau/mkdocs-macros-plugin#240

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

No branches or pull requests

2 participants