Code blocks are not properly handled #607

Open
opened 2026-01-29 14:41:03 +00:00 by claunia · 2 comments
Owner

Originally created by @TheArcaneBrony on GitHub (Jun 26, 2023).

Turning this markdown codeblock into HTML throws an argument out of bounds exception:
Unhandled exception. System.ArgumentException: Markdown elements in the input are too deeply nested - depth limit exceeded. Input is most likely not sensible or is a very large table.
This should be a single codeblock with text content... Excuse the missing newlines in the body.

[?25l[?7l -\` .o+\` \`ooo/ \`+oooo: \`+oooooo: -+oooooo+: \`/:-:++oooo+: \`/++++/+++++++: \`/++++++++++++++: \`/+++ooooooooooooo/\`  ./ooosssso++osssssso+\`  .oossssso-\`\`\`\`/ossssss+\` -osssssso. :ssssssso. :osssssss/ osssso+++. /ossssssss/ +ssssooo/- \`/ossssso+/:- -:/+osssso+- \`+sso+:-\` \`.-/+oso: \`++:. \`-/+/ .\` \`/ root@Rory@Rory-desktop ---------------------- OS: Arch Linux btw x86_64 Host: Micro-Star International Co., Ltd. X470 GAMING PLUS MAX (MS-7B79) Kernel: 6.3.8-zen1-1-zen Uptime: 31 mins Packages: 1922 (pacman) Shell: zsh 5.9 Resolution: 3840x2160, 1920x1080 WM: bspwm Theme: Adwaita [GTK2/3] Icons: Adwaita [GTK2/3] Terminal: dotnet CPU: AMD Ryzen 5 3600 (12) @ 3.600GHz GPU: NVIDIA GeForce RTX 2060 Rev. A GPU: NVIDIA GeForce GTX 760 OEM Memory: 12508MiB / 40052MiB                   [?25h[?7h
Originally created by @TheArcaneBrony on GitHub (Jun 26, 2023). Turning this markdown codeblock into HTML throws an argument out of bounds exception: `Unhandled exception. System.ArgumentException: Markdown elements in the input are too deeply nested - depth limit exceeded. Input is most likely not sensible or is a very large table.` This should be a single codeblock with text content... Excuse the missing newlines in the body. ```ansi [?25l[?7l -\` .o+\` \`ooo/ \`+oooo: \`+oooooo: -+oooooo+: \`/:-:++oooo+: \`/++++/+++++++: \`/++++++++++++++: \`/+++ooooooooooooo/\`  ./ooosssso++osssssso+\`  .oossssso-\`\`\`\`/ossssss+\` -osssssso. :ssssssso. :osssssss/ osssso+++. /ossssssss/ +ssssooo/- \`/ossssso+/:- -:/+osssso+- \`+sso+:-\` \`.-/+oso: \`++:. \`-/+/ .\` \`/ root@Rory@Rory-desktop ---------------------- OS: Arch Linux btw x86_64 Host: Micro-Star International Co., Ltd. X470 GAMING PLUS MAX (MS-7B79) Kernel: 6.3.8-zen1-1-zen Uptime: 31 mins Packages: 1922 (pacman) Shell: zsh 5.9 Resolution: 3840x2160, 1920x1080 WM: bspwm Theme: Adwaita [GTK2/3] Icons: Adwaita [GTK2/3] Terminal: dotnet CPU: AMD Ryzen 5 3600 (12) @ 3.600GHz GPU: NVIDIA GeForce RTX 2060 Rev. A GPU: NVIDIA GeForce GTX 760 OEM Memory: 12508MiB / 40052MiB                   [?25h[?7h ```
claunia added the question label 2026-01-29 14:41:03 +00:00
Author
Owner

@xoofx commented on GitHub (Jul 8, 2023):

Turning this markdown codeblock into HTML throws an argument out of bounds exception:

You mean simple code blocks with a single ` ? In that case, the block wouldn't be escapable because there are backsticks in that strings that will conflict. The nesting error is probably due to a block escaping and then there are multiple e.g [ that are going to create parsing errors because the parser thinks that these are going to be links.

A fenced code block ``` should work otherwise use a double backstick (or more) `` code blocks.

@xoofx commented on GitHub (Jul 8, 2023): > Turning this markdown codeblock into HTML throws an argument out of bounds exception: You mean simple code blocks with a single `` ` `` ? In that case, the block wouldn't be escapable because there are backsticks in that strings that will conflict. The nesting error is probably due to a block escaping and then there are multiple e.g `[` that are going to create parsing errors because the parser thinks that these are going to be links. A fenced code block ```` ``` ```` should work otherwise use a double backstick (or more) ``` `` ``` code blocks.
Author
Owner

@TheArcaneBrony commented on GitHub (Oct 1, 2023):

What i meant was eg. putting the output of neofetch inside of a fenced codeblock.

@TheArcaneBrony commented on GitHub (Oct 1, 2023): What i meant was eg. putting the output of `neofetch` inside of a fenced codeblock.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#607