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

lazy_async_image breaks headings #2679

Open
Mobbstar opened this issue Oct 26, 2024 · 1 comment
Open

lazy_async_image breaks headings #2679

Mobbstar opened this issue Oct 26, 2024 · 1 comment
Labels

Comments

@Mobbstar
Copy link

Bug Report

Environment

Zola version: 0.19.2

Expected Behavior

When set to true, I expect lazy_async_image to only affect how markdown images (![alt text](path "title text")) are rendered as HTML.

Current Behavior

When setting lazy_async_image to true, markdown headers generate empty IDs.

Further issues, which are most likely consequences of the above: The page.toc still contains an entry for each header, but is missing the name and ID too. The link-checker throws an error if any links refer to the header by the expected ID.

Step to reproduce

minimal example:

content/_index.html

+++
+++
![](https://en.wikipedia.org/static/images/icons/wikipedia.png)
# Heading
[link](#heading)

templates.html (using the ToC code from the docs)

<!DOCTYPE html><html lang="en"><head></head><body>
    {%- if section.toc %}
    <ul>
    {%- for h1 in section.toc %}
        <li>
            <a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
        </li>
    {%- endfor %}
    </ul>
    {%- endif %}
    {{ section.content | safe }}
</body></html>

config.toml

base_url = "https://example.local/"
[markdown]
lazy_async_image = true

P.S.

Thanks for making Zola. It's fun and useful so far.

@Keats Keats added the bug label Nov 1, 2024
@Keats
Copy link
Collaborator

Keats commented Nov 1, 2024

That's very odd, this attribute is only used for image related events. I don't see off hand how it would cause this issue 🤔

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

No branches or pull requests

3 participants
@Keats @Mobbstar and others