Nested if in ordered list
I've been trying in markdown, but could not achieve the below in markdown.
See: https://svelte.dev/repl/39a28b6d8ad54f409c75106a1871f357?version=3.31.0
<script>
let test = true;
</script>
<ol>
<li>
My First Item
<ol>
<li>My Nested First Item</li>
<li>
My Nested Second Item
<ol>
{#if test}
<li>Nested Deep</li>
<li>Nested Deep</li>
{/if}
<li>Nested Deep - Bookmarked</li>
</ol>
</li>
<li>My Nested Third Item</li>
<li>My Nested 4th Item</li>
</ol>
</li>
<li>My Second Item</li>
<li>My Third Item</li>
<li>My 4th Item</li>
</ol>
The below loses numbering due to the if block.
1. First item
1. Second item
1. Third item
{#if test }
1. Indented item
1. Indented item
{/if}
1. Third item
1. Fourth item
1. Fourth item
The below can't even compile:
1. First item
1. Second item
1. Third item
{#if test }
1. Indented {#if test }item{/if}
1. Indented item
{/if}
1. Third item
1. Fourth item
1. Fourth item
The part about loose lists here applies?
https://github.github.com/gfm/#lists
Currently it is unsupported feature. I'll research is it possible to realize it.
What would it take to realize this? Maybe another preprocessor to remove <p> nodes around if tags?
It is hard to implement all edgecases in markdown preprocessor. List inside if is separate list. I don't know how to fix it and not to break behavior in common cases. Somebody helps maybe.