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

Adjoined comments fail to render correctly #584

Closed
rien333 opened this issue Jan 12, 2021 · 2 comments
Closed

Adjoined comments fail to render correctly #584

rien333 opened this issue Jan 12, 2021 · 2 comments

Comments

@rien333
Copy link

rien333 commented Jan 12, 2021

While I'm a huge fan of this mode, one thing has bugged me for years: whenever you create two adjoining (HTML) comments — without any whitespace between them — the second renders in the default face, instead of the comment face. This is annoying to me, since my documents are filled with comments, meaning that I have to jump to all sorts of hoops to make two adjoining comments discernible from the main text (I write academic documents in markdown on a daily basis, and I use comments for all sorts of purposes).

It's of course possible to solve this issue by inserting whitespace in between the two comments. However, this distracts me from my writing flow, and, more importantly, creates unwanted whitespace in the resulting document (e.g. a pdf I create from the .md file; see screenshot in §Actual Behavior).

Note that this does not happen in emacs' HTML-mode (i.e. both adjoining comments render in the correct face). As such, this issue should in principle be solvable.

Expected Behavior

Whenever two comments are placed side-by-side (without whitespace between them), both should render in the markdown-comment-face.

Actual Behavior

The second comment is rendered in the default face. Here is a screenshot that shows the problem:

2021-01-12-1610458263

Steps to Reproduce

  1. Create a .md file with the following contents:
Main text <!--a comment--><!--another comment-->.

(ironically, github does render this example correctly when using markdown syntax highlighting!)

Backtrace

Not applicable I think; this is reproducible using emacs -Q.

Software Versions

  • Markdown Mode: 20210107.101 (though this issue has been present in versions from years ago)
  • Emacs: 25–28 (I think I started emacs around version 25, and this bug has always been present)
  • OS: tested on Linux (kernels 4.x–5.x), macOS
@syohex
Copy link
Collaborator

syohex commented Jan 12, 2021

I have merged #585. Please check latest version.

@syohex syohex closed this as completed Jan 12, 2021
@rien333
Copy link
Author

rien333 commented Jan 12, 2021

Works great now, thank you so much!

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