Skip to content

linenos on an indented code block outputs 1 for every line of code #1795

Open
@neelkamal0310

Description

@neelkamal0310

Bug Report

Environment

Zola version: 0.15.3
OS: Arch Linux
Kernel: linux-zen 5.16.13-zen1-1

Expected Behavior

When using linenos in an indented code block the output should be:

  • 1 for the first line of code
  • 2 for the second line of code
  • 3 for the third line of code
  • ... and so on

Current Behavior

When using linenos on an indented code block, the output in corresponding HTML is 1 for every line of code.

Screenshot:
image

Step to reproduce

  • Create a new zola project. zola init project
  • Create templates/index.html with content:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    {{ section.content | safe }}
</body>
</html>
  • Create content/_index.md with a list and an indented code block:

    _index.md for above screenshot

  • Start zola server; zola serve

  • Go to 127.0.0.1:1111 in browser.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions