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

Linenos and minification #1743

Closed
pcoves opened this issue Jan 24, 2022 · 3 comments
Closed

Linenos and minification #1743

pcoves opened this issue Jan 24, 2022 · 3 comments
Labels
bug done in pr Already done in a PR

Comments

@pcoves
Copy link

pcoves commented Jan 24, 2022

Bug Report

Environment

Zola version: 0.15 (already in 0.14)

Expected Behavior

Multiple fenced blocks with linenos should coexists with minify_html = true.

Current Behavior

If there are multiple fenced blocks with linenos, the code block spread from first to last.
Meaning, it embeds everything on its path, including non-code-block content.

Step to reproduce

config.toml

Enable highlighting and minification.

base_url = "https://example.com"
compile_sass = true
build_search_index = false
minify_html = true

[markdown]
highlight_code = true

[extra]

templates/index.html

<html>
    <body>
        {{ section.content | safe }}
    </body>
</html>

content/_index.md

+++
+++

```linenos
One line: no issue
Two or more lines: issue
```

Foo
Bar
Baz

```linenos
Autruche
```

2022-01-24-145543_254x125_scrot

2022-01-24-145617_284x195_scrot

@Keats Keats added the bug label Jan 24, 2022
@mwcz
Copy link
Contributor

mwcz commented Jan 26, 2022

There were some unclosed <tr> and <td> tags for multi-line fenced code blocks in components/rendering/src/codeblock/mod.rs. PR incoming.

@welpo
Copy link
Contributor

welpo commented Jul 6, 2023

Is the fix live as of 0.17.2?

I'm having this issue of "unclosed tables", even with a single blockcode with linenos.

The issue disappears when I set minify_html to false.

@Keats
Copy link
Collaborator

Keats commented Jul 6, 2023

It's live yes. There is another issue with class-based block formatters though: #2237 and the related issue.

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

No branches or pull requests

4 participants