Atom editor markdown html syntax highlighting


#1

Is there a package that styles html content inside of .md (markdown) files?


#2

Doesn’t normal GFM syntax work there?
https://help.github.com/articles/github-flavored-markdown#syntax-highlighting

It works for me for both markdown editing and preview.


Syntax highlight on Markdown Preview not working
#3

@heikki I am referring to inline html:

<p>TEST AWESOME</p>
<p>TEST AWESOME</p>
<p>TEST GREAT</p>

The standard markdown works.

I used to see the tag color coded in ST2/ST3.

Thoughts?


#4

This is how it looks to me:

Maybe you are not specifying the syntax there? Sublime doesn’t seem to need it.


#5

How did you turn that on @heikki? This is what I see :frowning:


#6

@chrishough I have the same issue. It seems the markdown syntax highlighting is a bit finicky.

For example:

##hello##
This will not be syntax highlighted as a title

hello

This will

I’ll do some more investigating.


#7

Thanks you so much for looking into this. I appreciate it.


#8

I too am looking for this. Not highlighting of a code block like @heikki shows but for actual html as part of the text flow in the markdown.

I have cases like this where I clearly want to see the <div class="clearfix"></div> and other such html.


#9

Well, it works if you put it inside code blocks, but I understand that’s not ideal for you:


#10

A solution would be to extend the html syntax so that everything that wasn’t matched by the html rules gets treated as gfm markdown (included text nodes if the grammar recognize them)


#11

I think he wants an actual clearfix div in the output of the markdown converter, not a visualization of the source code for a clearfix div.


#12

This is what it looks like in Brackets (the editor). I am not trying to make a request or such. Just testing Atom as a possible replacement of Sublime and want to make sure I am not skipping it cause I missed some features that are present if only I turned it on or install the correct plugin(s).


#13

Yea so that looks like what a grammar would usually do, i.e. in this case the Github Flavored Markdown language.

I’d open an issue on the relevant repo for this. I certainly agree this should be implemented.


#14

I have the same problem here. I see no syntax highlighting in a md file while using Github Markdown (which I assume is the same as GFM)


#15

GFM == GitHub Flavored Markdown == GitHub Markdown

Have you followed the suggestions in the Debugging document? Also, could you give the following information?

  • Which version of Atom are you using?
  • What OS and version are you running?
  • Can you reproduce the issue after completely exiting Atom and restarting using atom --safe?
  • What syntax theme are you using?
  • Exactly what text do you have in the Markdown file that is not colored? And what do you expect it to be colored like?

#16

Which version of Atom are you using?
0.136.0

What OS and version are you running?
Maverick (10.9.5)

Can you reproduce the issue after completely exiting Atom and restarting using atom --safe?
The issue remains

What syntax theme are you using?
Monokai/Atom Dark produce the same result

Exactly what text do you have in the Markdown file that is not colored? And what do you expect it to be colored like?
That’s a good question. My comment is based on what I see in sublime. For example:

In sublime

In atom (…to continue)


#17

As you can see, the div/iframe tags are colored in sublime but they look like plane text in atom. In addition (aside comment), I don’t know how to make a long string to continue in the next line.

Thanks.


#18

I opened an issue on the language-gfm package for this:

The reason why I asked what you expected @rvalenzuelar, is because you said:

I see no syntax highlighting in a md file

So I wanted to make sure if you were having the same issue of HTML sections not being highlighted, which is expected because the syntax definition doesn’t support that, or if you were seeing no highlighting at all which would have been a completely different issue :grinning:


#19

You are right @leedohm, the problem is the embedded html. Thanks for taking care of this, I’d really like to keep using Atom but so far this is a limitation. I’ll look forward for a solution.


#20

See the settings page, scroll to the bottom and see “soft wrap”.