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

Numbered lists have unwanted line feed / carriage control after the number. #162

Open
bwims opened this issue Jun 22, 2024 · 2 comments
Open

Comments

@bwims
Copy link

bwims commented Jun 22, 2024

Issue description

Numbered lists have line breaks after the numbers

Markdown to reproduce

1. **Basic Shed with Insulation:**
   - **Size:** Small (6x4 ft to 8x6 ft)
   - **Cost:** £1,500 to £3,000
   - **Details:** Includes basic insulation, simple interior finishes, and no additional services like electricity or plumbing.

2. **Standard Garden Office:**
   - **Size:** Medium (10x8 ft to 12x10 ft)
   - **Cost:** £5,000 to £10,000
   - **Details:** Better quality insulation, basic interior finishes, electricity, and potentially some heating solutions.

3. **High-End Garden Studio/Office:**
   - **Size:** Large (12x10 ft to 20x12 ft)
   - **Cost:** £10,000 to £25,000+
   - **Details:** High-quality insulation, premium interior finishes, full electrics, heating, double-glazed windows, and possibly plumbing for water supply and drainage.

Screenshot

This is what the VSCode preview shows ( I believe correctly)

image

This is what MarkdownViewerPlusPlus displays (I believe incorrectly

image

Environment

  • Notepad++ 8.5.8 (x64)
  • MarkdownViewer++ 0.8.2.0
  • Windows 10 (x64)
@alcoolfire
Copy link

I am experiencing the same problem, but it doesn't matter if it is a numbered or bulleted list. The bug is triggered only when there is at least one blank line between at least one adjacent pair of list items, a so-called "loose" list. The bug is not triggered for "tight" lists. So, this tight list markdown will render correctly in MarkdownViewer++:

- first
- second
- third

but this loose list will not:

- first

- second
- third

and neither will this loose list:

- first

- second

- third

The CommonMark list spec seems clear to me:

A list is a sequence of one or more list items of the same type. The list items may be separated by any number of blank lines.

Markdown source is supposed to be relatively human-friendly, which is why loose lists are permitted and used by many people. Nothing in the markdown specs that I've found should ever lead to a line break being inserted between a list marker and its associated text.

Notepad++ v7.9.2 and MarkdownViewer++ v0.8.2.25525

@alcoolfire
Copy link

The CommonMark spec Example 306 shows the HTML to be generated for loose lists, which follows. It is the addition of the <p> tags that are used for loose lists:

<ul>
<li>
<p>foo</p>
</li>
<li>
<p>bar</p>
</li>
<li>
<p>baz</p>
</li>
</ul>

Try that in a mainstream web browser. Courtesy of GitHub markdown support, the following should show the result in whatever browser one happens to be viewing this bug report with:

  • foo

  • bar

  • baz

Then paste that very same block of HTML into a markdown file for MarkdownViewer++ to render and one will see it rendered incorrectly (line break between list markers and text). I think this suggests a bug in the embedded HTML renderer in MarkdownViewer++ rather than in the markdown-to-HTML conversion stage.

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

No branches or pull requests

2 participants