[GH-ISSUE #485] MD031 fix in lists adding extra list item markers #399

Closed
opened 2026-03-03 01:26:34 +03:00 by kerem · 4 comments
Owner

Originally created by @nschonni on GitHub (Jan 18, 2022).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/485

Source

1.  ```js
    alert('hello!');
    ```
2.  ```js
    document.querySelector('html').style.backgroundColor = 'purple';
    ```
3.  ```js
    const myWordmark = document.createElement('img');
    myWordmark.setAttribute('src','https://blog.mozilla.org/press/wp-content/themes/OneMozilla/img/mozilla-wordmark.png');
    document.querySelector('h1').appendChild(myWordmark);
    ```

Result

1.  ```js
    alert('hello!');
    ```
2.
2.  ```js
    document.querySelector('html').style.backgroundColor = 'purple';
    ```
3.
3.  ```js
    const myWordmark = document.createElement('img');
    myWordmark.setAttribute('src','https://blog.mozilla.org/press/wp-content/themes/OneMozilla/img/mozilla-wordmark.png');
    document.querySelector('h1').appendChild(myWordmark);
    ```
Originally created by @nschonni on GitHub (Jan 18, 2022). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/485 Source ~~~md 1. ```js alert('hello!'); ``` 2. ```js document.querySelector('html').style.backgroundColor = 'purple'; ``` 3. ```js const myWordmark = document.createElement('img'); myWordmark.setAttribute('src','https://blog.mozilla.org/press/wp-content/themes/OneMozilla/img/mozilla-wordmark.png'); document.querySelector('h1').appendChild(myWordmark); ``` ~~~ Result ~~~md 1. ```js alert('hello!'); ``` 2. 2. ```js document.querySelector('html').style.backgroundColor = 'purple'; ``` 3. 3. ```js const myWordmark = document.createElement('img'); myWordmark.setAttribute('src','https://blog.mozilla.org/press/wp-content/themes/OneMozilla/img/mozilla-wordmark.png'); document.querySelector('h1').appendChild(myWordmark); ``` ~~~
kerem 2026-03-03 01:26:34 +03:00
Author
Owner

@nschonni commented on GitHub (Jan 18, 2022):

Also noticed this for unordered lists

Source:

There are two ways to specify a page action: with or without a [popup](/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Popups).

- **Without a popup:** When the user clicks the button, an event is dispatched to the extension, which the extension listens for using [`pageAction.onClicked`](/en-US/docs/Mozilla/Add-ons/WebExtensions/API/pageAction/onClicked "Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup."):
- ```js
  browser.pageAction.onClicked.addListener(handleClick);
  ```
- **With a popup:** the `click` event is not dispatched. Instead, the popup appears when the user clicks the button. The user then interacts with the popup. When the user clicks outside of the popup, it closes automatically. See the [Popup](/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Popups) article for more details on creating and managing popups.

Result

There are two ways to specify a page action: with or without a [popup](/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Popups).

- **Without a popup:** When the user clicks the button, an event is dispatched to the extension, which the extension listens for using [`pageAction.onClicked`](/en-US/docs/Mozilla/Add-ons/WebExtensions/API/pageAction/onClicked "Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup."):
-
- ```js
  browser.pageAction.onClicked.addListener(handleClick);
  ```

- **With a popup:** the `click` event is not dispatched. Instead, the popup appears when the user clicks the button. The user then interacts with the popup. When the user clicks outside of the popup, it closes automatically. See the [Popup](/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Popups) article for more details on creating and managing popups.
<!-- gh-comment-id:1015801149 --> @nschonni commented on GitHub (Jan 18, 2022): Also noticed this for unordered lists Source: ~~~md There are two ways to specify a page action: with or without a [popup](/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Popups). - **Without a popup:** When the user clicks the button, an event is dispatched to the extension, which the extension listens for using [`pageAction.onClicked`](/en-US/docs/Mozilla/Add-ons/WebExtensions/API/pageAction/onClicked "Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup."): - ```js browser.pageAction.onClicked.addListener(handleClick); ``` - **With a popup:** the `click` event is not dispatched. Instead, the popup appears when the user clicks the button. The user then interacts with the popup. When the user clicks outside of the popup, it closes automatically. See the [Popup](/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Popups) article for more details on creating and managing popups. ~~~ Result ~~~md There are two ways to specify a page action: with or without a [popup](/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Popups). - **Without a popup:** When the user clicks the button, an event is dispatched to the extension, which the extension listens for using [`pageAction.onClicked`](/en-US/docs/Mozilla/Add-ons/WebExtensions/API/pageAction/onClicked "Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup."): - - ```js browser.pageAction.onClicked.addListener(handleClick); ``` - **With a popup:** the `click` event is not dispatched. Instead, the popup appears when the user clicks the button. The user then interacts with the popup. When the user clicks outside of the popup, it closes automatically. See the [Popup](/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Popups) article for more details on creating and managing popups. ~~~
Author
Owner

@DavidAnson commented on GitHub (Jan 18, 2022):

I do not see the first behavior in the demo site. Please try there? https://dlaa.me/markdownlint/

I do see the second one.

<!-- gh-comment-id:1015804732 --> @DavidAnson commented on GitHub (Jan 18, 2022): I do not see the first behavior in the demo site. Please try there? https://dlaa.me/markdownlint/ I do see the second one.
Author
Owner

@nschonni commented on GitHub (Jan 18, 2022):

Yeah, maybe the OL version is fixed in the core. I'm getting these from markdownlint-cli, but I see the same correct fix in the browser

<!-- gh-comment-id:1015828227 --> @nschonni commented on GitHub (Jan 18, 2022): Yeah, maybe the OL version is fixed in the core. I'm getting these from markdownlint-cli, but I see the same correct fix in the browser
Author
Owner

@DavidAnson commented on GitHub (May 15, 2022):

This fixes both scenarios you report above.

<!-- gh-comment-id:1126845365 --> @DavidAnson commented on GitHub (May 15, 2022): This fixes both scenarios you report above.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#399
No description provided.