Codeblock in list #157

Closed
opened 2026-01-29 14:29:09 +00:00 by claunia · 1 comment
Owner

Originally created by @yishengjin1413 on GitHub (Nov 9, 2017).

Hi @xoofx,

We got some issue when "----" appeared in codeblock under listitem. Here is an example:

1. In the :
   
   ```
   Id                                   DisplayName         Description
   --                                   -----------         -----------
   62375ab9-6b52-47ed-826b-58e47e0e304b Group.Unified       ...
   ```

The render result of the above content will have hr. But actually it's the part of content. You can have a check here.

I checked the source code and seems hr will close the list. How about add a condition !(processor.LastBlock is FencedCodeBlock) in ListBlockarser#L89. Seems codeblock is the only special case.

Originally created by @yishengjin1413 on GitHub (Nov 9, 2017). Hi @xoofx, We got some issue when "----" appeared in codeblock under listitem. Here is an example: <pre> 1. In the : ``` Id DisplayName Description -- ----------- ----------- 62375ab9-6b52-47ed-826b-58e47e0e304b Group.Unified ... ``` </pre> The render result of the above content will have `hr`. But actually it's the part of content. You can have a check [here](https://babelmark.github.io/?text=1.+In+the+%3A%0A+++%0A+++%60%60%60%0A+++Id+++++++++++++++++++++++++++++++++++DisplayName+++++++++Description%0A+++--+++++++++++++++++++++++++++++++++++-----------+++++++++-----------%0A+++62375ab9-6b52-47ed-826b-58e47e0e304b+Group.Unified+++++++...%0A+++%60%60%60). I checked the source code and seems `hr` will close the list. How about add a condition `!(processor.LastBlock is FencedCodeBlock)` in [ListBlockarser#L89](https://github.com/lunet-io/markdig/blob/master/src/Markdig/Parsers/ListBlockParser.cs#L89). Seems codeblock is the only special case.
claunia added the bug label 2026-01-29 14:29:09 +00:00
Author
Owner

@xoofx commented on GitHub (Nov 9, 2017):

Thanks, good catch, this is fixed by 523582e

@xoofx commented on GitHub (Nov 9, 2017): Thanks, good catch, this is fixed by 523582e
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#157