[Bug:]Markdown: code block - empty line at end of block

I’m new to nextcloud, came over from OC and I’m really happy to be here!

This bug was already filed under https://github.com/nextcloud/text/issues/150. Thanks to @bb77 for the hint.

One petitesse:
When I create a code block with three backticks before and behind the code, such as (screenshot from text editor):

Bildschirmfoto von 2021-04-30 21-06-42

it renders to a result with an empty line in the very end (screenshot from firefox when calling the file via the public link https://nextcloud.rollentausch.eu/index.php/s/aYEabHB55N92fEb:
Bildschirmfoto von 2021-04-30 21-01-18

Should I use another code - or is it “unexpected behaviour”? (-;

I’m using NC 20.0.7
markdown editor (by Robin Appelman) 2.3.3
files are edited in qownnotes 21.1.3 and synced to the server.


Hello and welcome to the community help forum! :slightly_smiling_face:

We will try to help you, but without any information, we won’t be able to do so.

For example version information is missing completely. Also: Which app do you use? This is certainly not the shipped editor “Nextcloud Text” but looks more like this one. Can you confirm this?

Hi @stefan-niedermann

I think the first screenshot in @herrdeh post is indeed the Markdown App from your link. But the second screenshot is from the Nextcloud Text app.

It does the same for me. If I open any Markdown file with the Nextcloud Text app, it always renders a blank line to end of the codeblocks. It doesn’t matter which app the file was created with. Even if you create the file with the Nextcloud Text App itself, empty lines will be renderd to codeblocks, every time you open the file again.

It has defenitly something to do with how the Nextcloud Text app renders these files. Because if you open the same file in any other markdown app, e.g. Nextcloud Notes, it gets renderd just fine, without any blank space at the end of the code blocks.

Sorry for making the same mistakes repeatedly, even after 25 years in IT… ):
I tried to provide required info in the OP.

I tried the same code (characters, fenced by three backticks) in https://dillinger.io/. There I do not find an empty line - that’s what I expected.

Steps to reproduce the issue:

  1. Create a new markdown file with a codeblock inside the default Nextcloud Text app…

…and it’s gonna look something like this:

  1. Close the Text app with X in the upper right corner

  2. Refresh the browser page

  3. Open the file again…

…and it’s gonna look like this:

The same file in the Nextcloud Notes app looks like this:

…and in Discourse it looks like this: :wink:

Das ist ein Testdokument

This is a code block

Tested this on Arch Linux in Firefox 88

It happens on my production server with Nextcloud 20.0.9 as well as on my testserver with Nextcloud 21.0.1

OK. I should have looked at GitHub first… :wink:

There is already an issue on this topic:


…since 2019 :wink:

Depending on your textfile these empty lines even start to increase… thus you’ll see multiples empty lines after some time.
Old issue which is kind of annoying if you really work with nextcloud text.

Yep …and I don’t know why they have to reinvent the wheel, when there are so many working Markdown Editors already out there. But i’m not a developer and can therefore not really judge what is necessary to properly integrate such a function into an environment like Nextcloud.

They don’t. Nextcloud Text is based on ProseMirror markdown editor and adds just a few Nextcloud specific addidtions :wink:

Ah ok. Thanks.