Skip to content

[BUG]: Extra line in fenced code block in view mode #493

@alexandrescieux

Description

@alexandrescieux

Describe the bug

Summary

In Jotty, when reading a note in view mode, fenced code blocks render with an extra empty line at the end.

This extra line is also numbered, so it looks like the code block contains one more line than it actually does.

Markdown editor :
Image

View note :
Image

Steps to reproduce

  1. Create or open a note containing a fenced code block in the Markdown Editor.
  2. Use this markdown fenced code block in any note :
```bash
Extraline with carriage return
```
  1. Switch to view mode.

Expected behavior

The code block should display only the actual lines of code, with matching line numbers and no extra empty line at the end.

How do you run Jotty?

Docker

Jotty Version

1.22.0

Checklist

  • I have searched across other issues to make sure this bug has not been already reported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions