Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for nested <ul>/<ol> tags without <li> (not technically valid) #445

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

dnotes
Copy link

@dnotes dnotes commented Aug 1, 2023

I'm opening this pull request for your re-consideration of issue #232. My reasoning is this:

  1. Although this syntax is invalid HTML, it has de-facto support in all browsers.
  2. Some people are making this mistake in writing their HTML.
  3. Converting that HTML to Markdown changes the semantic meaning that is clear in the original.
  4. It wasn't that hard to fix.

Please see my comment on #232.

Note that this PR differs slightly from the code that I pasted there; I think it's unnecessary to "fix" the case with an empty <li> element (<li><ul>...</ul></li>) because the meaning is preserved in the resulting markdown.

dnotes and others added 4 commits July 31, 2023 15:33
- fix invalid markdown when <ul> is nested inside an empty <li>
- add support for nested <ul>/<ol> outside of <li>
  (a common and widely supported usage, though not technically valid)
- empty li is allowed in html and markdown (who does this on purpose?)
- fixed edge case of numbering when <ol>s are nested without <li>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant