Qownnotes: Markdown code blocks are no longer formatted

Created on 8 Jan 2020  Â·  21Comments  Â·  Source: pbek/QOwnNotes

Expected behaviour

In 20.1.2 and prior, Markdown code blocks (4 spaces indented) are properly formatted (font and colors are applied):
20 1 2

Actual behaviour

In 20.1.3 and 20.1.5, the same text is no longer formatted:
20 1 3 and 20 1 5

Steps to reproduce

Create a note with 4-space-indented text.

Medium Bug - Regression

All 21 comments

Confirmed. Thank you for reporting.

@Waqar144, another regression?

20.1.6

  • fixed four spaces code blocks (for #1558, thank you @Waqar144)

Btw. it would be much better to use the code blocks with "ticks", then you can also profit from code block syntax highlighting.

There now is a new release, could you please test it and report if it works for you?

Yes, I confirmed that in 20.1.6, four-space code blocks are formatted again. Thanks, @pbek and @Waqar144!

Btw. it would be much better to use the code blocks with "ticks", then you can also profit from code block syntax highlighting

The syntax highlighting looks nice! I've started using it for some code blocks. (Though for very short snippets, like in my screenshot above, I prefer the more concise four-space syntax.)

Great, thank you for testing!

I just updated to 20.1.13, and four-space code blocks are broken again. 😇

Can you share a screenshot?

(It's exactly the same as the screenshots at the top of this issue.)

Ah yes,
The Library got updated, QON didn't. I guess it will be working in the next release.

Sounds good. Thanks.

20.1.14

  • fixed four spaces code blocks again (for #1558, thank you @Waqar144)

There now is a new release, could you please test it and report if it works for you?

Thanks; that's an improvement — if I add a blank line between the ## heading and the four-space code block, the code block is properly formatted. But if the heading and the four-space code block are adjacent, the code block isn't formatted — could you fix that?

| No blank line; code block _isn't_ formatted | Has blank line; code block _is_ properly formatted |
| - | - |
| Screen Shot 2020-01-22 at 1 48 17 PM-scaled | Screen Shot 2020-01-22 at 1 48 25 PM-scaled |

Hi.
That was a recent change to become more CommonMark compliant. CommonMark requires a space between an indented code block and preceding paragraph: https://spec.commonmark.org/0.29/#indented-code-block

Ah, thanks for the reference. Yes, for paragraphs, CommonMark requires a blank line, but if I understand correctly, CommonMark does not require a blank line after a header. On that page, example 85 says "indented code can occur immediately before and after other kinds of blocks" and demonstrates it by showing a heading followed by a four-space code block, without a blank line.

Yes indeed. Now I am thinking what do they mean by 'other'. Probably everything other than <p> I think. I think I will just enable it for everything. That'd be simpler and faster.

Now it allows indented code block after a heading (just like in the preview). For all other types of paragraphs, it will not work unless there is a blank line in between

20.1.15

  • fixed stacked code block highlighting and improved non-fenced code block highlighting (thank you @Waqar144)

There now is a new release, could you please test it and report if it works for you?

20.1.15 looks great. Thanks!

Great, thank you for testing!

Was this page helpful?
0 / 5 - 0 ratings