-
Notifications
You must be signed in to change notification settings - Fork 991
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
Fix markup for fenced code with linenos #1746
Conversation
I'll try to take a look at the test failures tomorrow. |
Eh, how about tonight instead. :) Just pushed a fix for the tests that involve fenced code and linenos. The test changes might be hard to scan visually due to the HTML being so dense. They all boil down to adding omitted <pre data-linenos data-lang="html" style="background-color:#2b303b;color:#c0c5ce;" class="language-html ">
<code class="language-html" data-lang="html">
<table>
<tbody>
<tr>
<td>1</td>
<td>
<span><</span>
<span style="color:#bf616a;">div </span>
<span style="color:#8fa1b3;">id</span>
<span>="</span>
<span style="color:#a3be8c;">custom-attr</span>
<span>">\n</span>
<!-- missing </td> -->
<!-- missing </tr> -->
<tr>
<td>2</td>
<td>
<span><</span>
<span style="color:#bf616a;">div </span>
<span>>\n</span>
<!-- missing </td> -->
<!-- missing </tr> -->
<tr>
<td>3</td>
<td>
<span> <</span>
<span style="color:#bf616a;">iframe </span>
<span style="color:#d08770;">src</span>
<span>="</span>
<span style="color:#a3be8c;">https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ</span>
<span>" </span>
<span style="color:#d08770;">webkitallowfullscreen mozallowfullscreen allowfullscreen</span>
<span>></</span>
<span style="color:#bf616a;">iframe</span>
<span>>\n</span>
<!-- missing </td> -->
<!-- missing </tr> -->
<tr>
<td>4</td>
<td>
<span></</span>
<span style="color:#bf616a;">div</span>
<span>>\n</span>
<!-- missing </td> -->
<!-- missing </tr> -->
<tr>
<td>5</td>
<td>
<span>\n</span>
<!-- missing </td> -->
<!-- missing </tr> -->
<tr>
<td>6</td>
<td>
<span></</span>
<span style="color:#bf616a;">div</span>
<span>>\n</span>
<!-- missing </td> -->
</tr>
</tbody>
</table>
</code>
</pre> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I'm planning to switch all those tests to insta which will be much nicer I guess.
* fix fenced code blocks with linenos and minify_html * fix test cases involving linenos
fixes #1743
The fix adds some missing
</td>
and</tr>
tags in the linenos tables. Some closing tags can be inferred by the browser, which is why this works withoutminify_html
, but I think it's best if Zola generates "normal" HTML and relies onminify_html
to remove unnecessary tags. Passing already-partially-minified HTML to minify seems to be causing this problem.Though, since the HTML is technically valid already, minify-html may deserve a patch to support it, but that's not something I have the energy for at the moment!
IMPORTANT: Please do not create a Pull Request adding a new feature without discussing it first.
The place to discuss new features is the forum: https://zola.discourse.group/
If you want to add a new feature, please open a thread there first in the feature requests section.
Sanity check:
Code changes
(Delete or ignore this section for documentation changes)
next
branch?If the change is a new feature or adding to/changing an existing one: