Skip to content
This repository was archived by the owner on Apr 15, 2026. It is now read-only.
This repository was archived by the owner on Apr 15, 2026. It is now read-only.

HTML Tags not closing with markdown extension #1598

@natsch93

Description

@natsch93

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>
codemirror-markdown-html-auto-close-tag-issue.mp4

Browser and platform

Chrome

Reproduction link

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions