jrblevin/markdown-mode

Faulty recognition of closing sequence in atx headers

kuranari opened this issue · 0 comments

Expected Behavior

  1. We want trailing spaces to be visible when markdown-hide-markup is enabled.
    • The current behavior results in an unnatural input experience(see the attached video for more details).
  2. The closing sequence must be preceded by a space or tab

Actual Behavior

  1. Trailing spaces are not visible when 'markdown-hide-markup' is enabled.
  2. A closing sequence is identified even without a trailing whitespace.

Steps to Reproduce

Input # foo# or ## Steps to Reproduce

default.mov

The whitespace appears when the next character is entered.

Software Versions

  • Markdown Mode: 2.6-alpha
  • Emacs: GNU Emacs 28.2
  • OS: macOS Ventura 13.3.1 (a)

Additional Details

The issue occurs due to the definition of markdown-regex-header.

Changes were introduced to align with the implementation of Markdown.pl as per this commit: 26e3937

While the behavior of the whitespace following the opening sequence was modified with this commit: 58ba6a3, the behavior of the whitespace preceding the closing sequence was not altered.