#1598·dev

HTML Tags not closing with markdown extension

Author: natsch93Created Aug 1, 2025Updated Apr 15, 2026

Describe the issue

HTML Tags are not closing automatically with markdown() extension.

<div> seems to work fine, and closes automatically.

But trying other elements like <b>, <a>, <label>, etc. does not work, unless a <div></div> is present above.

Reproduction steps:

  • Open the reproduction link
  • Enter <b>, notice how doesn't auto-close
  • Delete <b> and enter <div>, <div> auto-closes successfully
  • Go below the <div></div> and enter <b> again, this time auto-close is successful for <b>

https://github.com/user-attachments/assets/359379bf-2428-4c64-8f51-d016f951747b

Browser and platform

Chrome

Reproduction link

https://codemirror.net/try/#c=aW1wb3J0IHsgYmFzaWNTZXR1cCwgRWRpdG9yVmlldyB9IGZyb20gImNvZGVtaXJyb3IiCmltcG9ydCB7IG1hcmtkb3duIH0gZnJvbSAiQGNvZGVtaXJyb3IvbGFuZy1tYXJrZG93biIKCmxldCB2aWV3ID0gbmV3IEVkaXRvclZpZXcoewogIGRvYzogIiIsCiAgZXh0ZW5zaW9uczogWwogICAgYmFzaWNTZXR1cCwKICAgIG1hcmtkb3duKCksCiAgXSwKICBwYXJlbnQ6IGRvY3VtZW50LmJvZHkKfSk=