-
Notifications
You must be signed in to change notification settings - Fork 142
Description
Please confirm that you have searched existing issues in the repo
Yes, I have searched the existing issues
Any related issues?
Tell us about your environment
Window 10
MarkBind version
v4.1.0
Describe the bug and the steps to reproduce it
Consider the following code:
* item 1
* item 2
* item 2.1
* item 2.2
{icons="light-bulb"}
* item 3
{icons="thumbs-up"}
Here is the rendered output:
Observe that despite both the nested list and the outer list being declared identically, they render differently in HTML.
Innermost list items are output as standalone <li> elements, whereas the outer list items are wrapped within <li><p>{item}</p></li>. This inconsistency suggests a potential bug in our current processing pipeline, meriting further investigation and potentially the filing of a new issue.
However, all parameters are preserved, enabling DOM manipulation to achieve the desired output. Consequently, we should refine our processing pipeline to standardize and bring consistency to the output, thereby enhancing the predictability and reliability of our rendering process.
Expected behavior
Both outer layer and inter layer should be render the same way:
Code:
* item 1 Without P Fix this
* item 1.1 With P
* item 1.2 With P
* item 2 Without P Fix this
* item 2.1 With P
* item 2.1 Without P
* item 2.2 Without P
* item 2.2 With P
* item 3 Without P Fix this
* item 3.1 Without P Fix this
* item 3.1.1 Without P
* item 3.1.2 Without P
* item 3.2 Without P Fix this
{icons="light-3"}
* item 4 Without P Fix this
* item 4.1 With P
* item 4.1.1 Without P
* item 4.1.2 Without P
* item 4.2 With P
{icons="light-4"}
{icons="thumbs-up"}
Anything else?
Please refer to the official markdown-it-attrs documentation on GitHub for an explanation of ambiguous syntax: markdown-it-attrs Ambiguity Syntax.
The recommended way of declaring block variables is not consistent and intuitive. Therefore, a standardization and improvement is required. It might look something like this:
* item 1 With P Fix this
* item 1.1 With P
* item 1.2 With P
* item 2 With P Fix this
* item 2.1 With P
* item 2.1 Without P
* item 2.2 Without P
* item 2.2 With P
{icons="light-2"}
* item 3 With P Fix this
* item 3.1 Without P Fix this
* item 3.1.1 Without P
* item 3.1.2 Without P
* item 3.2 Without P Fix this
{icons="light-3"}
* item 4 With P Fix this
* item 4.1 With P Fix this
* item 4.1.1 Without P
* item 4.1.2 Without P
* item 4.2 With P Fix this
{icons="light-4"}
{icons="thumbs-up"}
