Added multi-paragraph support inside list items and blockquotes.#1
Open
heshammahamed wants to merge 1 commit into
Open
Added multi-paragraph support inside list items and blockquotes.#1heshammahamed wants to merge 1 commit into
heshammahamed wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A blank line followed by indented continuation inside a list item
broke out of the list entirely, producing a stray
<p>instead ofstaying inside the
<li>:Summary
Added a new rule to handle multi-paragraph continuation inside list items and blockquotes. When a blank line is followed by indented content, the translator now creates a new
<p>inside the current<li>or<blockquote>rather than closing the element.Updated
ulandolelement tags to wrap<li>content in<p>tag (<ul><li><p> / </p></li></ul>), which is required for multi-paragraph list items to produce valid HTML.Update
blockquoteelement tags to wrap content in<p>tag (<blockquote><p> / </p></blockquote>) which is required for multi-paragraph blockquote to produce valid HTML.Design Decision: Always Loose Lists
The library now always treats lists as loose (content inside
<li>is always wrapped in<p>), rather than implementing the CommonMark loose/tight list distinction.CommonMark definition:
Implementing this distinction correctly requires look-ahead — the parser must scan the entire list before deciding whether to wrap content in
<p>.Since this library processes Markdown as a left-to-right stream with no look-ahead, implementing true tight/loose detection is not feasible without a significant architectural change.
Treating all lists as loose is a deliberate simplification. The output is valid HTML and is consistent with how many other lightweight Markdown libraries behave.